Skip to content

Commit 6defd7c

Browse files
Merge pull request #39 from MaterializeInc/push-yyuuplqptrow
allow configuring the underlying controller directly
2 parents 5506e84 + 462ba24 commit 6defd7c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/controller.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,17 @@ where
192192
.await
193193
}
194194

195-
pub fn with_concurrency(mut self, concurrency: u16) -> Self {
196-
self.controller = self
197-
.controller
198-
.with_config(kube_runtime::Config::default().concurrency(concurrency));
195+
/// Allow configuring the underlying [`kube_runtime::Controller`]. For
196+
/// example, you can use
197+
/// `controller.with_controller(|controller| controller.with_config(Config::default().concurrency(10)))`
198+
/// to limit the created controller to reconciling 10 resources at once.
199+
pub fn with_controller<F>(mut self, f: F) -> Self
200+
where
201+
F: FnOnce(
202+
kube_runtime::Controller<Ctx::Resource>,
203+
) -> kube_runtime::Controller<Ctx::Resource>,
204+
{
205+
self.controller = f(self.controller);
199206
self
200207
}
201208
}

0 commit comments

Comments
 (0)