diff --git a/src/controller.rs b/src/controller.rs index 802bbff..64d8431 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -192,10 +192,17 @@ where .await } - pub fn with_concurrency(mut self, concurrency: u16) -> Self { - self.controller = self - .controller - .with_config(kube_runtime::Config::default().concurrency(concurrency)); + /// Allow configuring the underlying [`kube_runtime::Controller`]. For + /// example, you can use + /// `controller.with_controller(|controller| controller.with_config(Config::default().concurrency(10)))` + /// to limit the created controller to reconciling 10 resources at once. + pub fn with_controller(mut self, f: F) -> Self + where + F: FnOnce( + kube_runtime::Controller, + ) -> kube_runtime::Controller, + { + self.controller = f(self.controller); self } }