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![];