-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Controller<T> event duplication #279
Comments
This is to be expected, I'm afraid. The alternative would be pretty racy and unexpected (store the last-written IMO this also generally fits the expected behaviour. If you have a |
I guess some controllers store spec hashes somewhere. Maybe that's to avoid doing the work multiple times. If controllers can do that then at least there are solutions. |
Yeah, controller-runtime has a few predicates to help with event filtering on the reconcilers (looks similar to |
I think the difficulty here is whether or not we should force this behavior on the Not sure what people think. I think at least we could have some helpers for how to do it manually; like showing how to track it in Side note; was looking at the mutation_detector, it's got a memory leak by design from looking at the comments. |
FWIW, you can actually do that kind of filtering without memory leaks, by putting the filter as a stage between |
Coming back to this, this is probably the next thing I'd like to improve. Want to investigate whether we can inject some kind of event filter at the very end of the applier loop (so that potentially reconciles won't get called if some injectable This feels similar to what users would have to write in their apps if they want to have a "do constant work" type reconciler (e.g. something like #354) that perhaps updates status objects even if nothing technically changed on the object itself. This might be awkward for events that do not come from the root type, but by types that are owned by the root type - I am hoping that the filter can be avoided in those cases. |
This can now be iltered out via predicates using the controller stream interface. See kube-rs/controller-rs#50 for how this can look in practice. |
Noticing an issue where we are receiving events for the patch operations we did to our own crd's status.
example reconciler from controller-rs
This is the dumbest reconciler we have in any example;
But the last step now triggers the reconciler again because the crd was touched (by ourselves).
It perhaps possible that we can put an "ignore" on events coming in from the event that we "expect" to see updates, but that seems error prone (as well as difficult).
Not sure this is necessarily a bad thing, but I expect this is counter-intuitive.
Because you were so helpful last time around @alexeldeib , do you have any hints from
controller-runtime
for this?The text was updated successfully, but these errors were encountered: