Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper to reschedule all objects for reconciliation #555

Merged
merged 3 commits into from
Jun 20, 2021

Conversation

nightkr
Copy link
Member

@nightkr nightkr commented Jun 16, 2021

Fixes #551

@nightkr nightkr requested review from clux and kazk June 16, 2021 15:09
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks nice!

Comment on lines 397 to 400
/// Trigger a reconciliation for all managed objects whenever `trigger` emits a value
///
/// For example, this can be used to reconcile all objects whenever the controller's configuration changes.
pub fn reconcile_all_on(mut self, trigger: impl Stream<Item = ()> + Send + Sync + 'static) -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this looks surprisingly simple!

Any chance you can put an example here for it? (can mark it no_run if it pulls in too much)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7420965

Never actually runs (the Controller is never polled) since that would require a K8s cluster to run against.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it illustrates the use case well! Thank you.

Now I guess users can wrap the stream in whatever read-write protection they want and push an item into it from a http endpoint / whatever hook they want.

@nightkr nightkr merged commit 7627764 into kube-rs:master Jun 20, 2021
@nightkr nightkr deleted the feature/controller-restart branch June 20, 2021 13:24
@clux
Copy link
Member

clux commented Jul 5, 2021

released in 0.58, thanks again for all of these!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restart controller
2 participants