kube icon indicating copy to clipboard operation
kube copied to clipboard

allow filtering watcher events when !observedGeneration changed

Open clux opened this issue 6 years ago • 2 comments

rationale: we don't necessarily want to receive events when the .status object changes

clux avatar Jul 20 '19 17:07 clux

This would require maintaining a map of ObjectRef -> observedGeneration (int) inside a watcher / reflector and checking if it changed before bubbling up the event (first added event would always succeed)

Not quite what the best way to extend this, it's not very nice to have this in the internal watcher state by default, so need to have this optional somehow. It's a bit of a niche feature, and honestly, mostly for controllers to filter out its own modifications, so probably should think about this holistically in #279

clux avatar Mar 08 '20 21:03 clux

PoC in https://github.com/kube-rs/controller-rs/commit/7e2a15274d0ef99a3b7c841446bc104535ed2118 using the impl trait magic that @teozkr brought for runtime conditions. I think this is viable in terms of inclusion, but there's probably some cleanups. Feel free to drop some comments, otherwise I'll prepare a PR for that and await reviews then.

clux avatar May 13 '22 19:05 clux