From db2a6856bfb6d6aa09cb1d6fdfc017c4111cf9b9 Mon Sep 17 00:00:00 2001 From: gonzalezzfelipe Date: Thu, 7 Nov 2024 19:17:42 -0300 Subject: [PATCH] fix: Make operator namespaced --- src/bin/operator.rs | 2 +- src/controller.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/operator.rs b/src/bin/operator.rs index a268595..09a4b5a 100644 --- a/src/bin/operator.rs +++ b/src/bin/operator.rs @@ -23,7 +23,7 @@ async fn main() -> Result<()> { let context = Arc::new(K8sContext::new(client.clone(), config)); // Create controller for MyApp custom resource - let api: Api = Api::all(client); + let api: Api = Api::default_namespaced(client); info!("Running controller."); let controller = Controller::new(api, Default::default()) .run(reconcile, error_policy, context.clone()) diff --git a/src/controller.rs b/src/controller.rs index 4a100d1..0fcdf14 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -379,7 +379,7 @@ impl K8sContext { } async fn patch_statuses(&self) -> anyhow::Result<()> { - let api: Api = Api::all(self.client.clone()); + let api: Api = Api::default_namespaced(self.client.clone()); let crds = api.list(&ListParams::default()).await?; let mut awaitables = vec![];