feat: move controller informer-related configuration to InformerConfig - #2455
Conversation
1b8aae5 to
4c776aa
Compare
309d3b7 to
db3b7e1
Compare
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
261e5f5 to
99ca7e2
Compare
csviri
left a comment
There was a problem hiding this comment.
Made some changes, I think we should discuss mainly some naming and API issues mentioned, mainly the one related to the followControllerNamespacesOnChange.
Shall we just document that, that it is a problem. Maybe we can check and throw an exception if that is set explicitly for the controller?!
| .withInformerConfiguration(c -> c.withLabelSelector(SELECTOR)) | ||
| .build(), context); | ||
| var ingressEventSource = | ||
| new InformerEventSource<>(InformerConfiguration.from(Ingress.class, WebPage.class) |
There was a problem hiding this comment.
This feels little weird, maybe just naming issue but
InformerConfiguration.from(..).withInformerConfiguraiton(...) somehow does not sounds right.
There was a problem hiding this comment.
Here we could just simply hide the holder, and put back the with* methods that would result a simpler / cleaner API.
There was a problem hiding this comment.
The idea is to reuse the same code at some point to deal with the InformerConfig… and yes, the naming is sub-optimal, which is why I'd like to clean things up but I'd rather do that in a subsequent PR
There was a problem hiding this comment.
I mean, we could just let the old methods, like here, the withLabelSelector will be in the background the InformerConfigHolder. Would be good to have this in this PR, this is something I would not release for sure. But if you insist feel free to do separately.
There was a problem hiding this comment.
I think I had tried that (or some variation of it) but maybe I didn't. Let me see what it does.
There was a problem hiding this comment.
I would re-add these methods after we're done with renaming and cleaning-up if we feel it's necessary.
| @@ -21,56 +24,60 @@ | |||
| String name() default NO_VALUE_SET; | |||
There was a problem hiding this comment.
name does not makes too much sense for the controller either :(
There was a problem hiding this comment.
I wondered about this, actually, if we could somehow reuse the same config for the controller and some other event source but yes, I agree that this doesn't make much sense for the controller.
The problem is that we cannot inherit between annotations so either:
- we have separate annotations that do more or less the same thing with code to process each that will again more or less do the same thing, which will cause quite a big maintenance load
- we accept that some of the setup doesn't make sense for both, add proper safeguards and live with it
- we extract the fields that don't make sense in a different annotation for event sources that will enclose an
InformerConfigfield but that adds yet another level of annotations, which would be less than ideal.
There was a problem hiding this comment.
Exactly, imo 1. or 2.
Not sure if that is that much more code to have a @ControllerInformer.
Or alternative is also just simply stick with the current approach and don't merge this PR.
There was a problem hiding this comment.
I think I would prefer 2. at this point, with more clean up on the naming, it should be much better, I just wanted to control the blast radius at this point :)
I don't see any changes. Did you push them?
Maybe. |
|
Thanks, I will open a subsequent PR to clean things up and rename things more appropriately. |
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
#2455) * feat: move controller informer-related configuration to InformerConfig Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: start isolating ResourceConfiguration Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: initFromAnnotation now properly inits the current instance Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: default onDeleteFilter implementation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly set default namespaces in controller case Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: remove KubernetesDependentInformerConfigBuilder Signed-off-by: Chris Laprun <claprun@redhat.com> * refactor: use InformerConfigHolder in more places, unifying handling Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: properly propagate name to informer config Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: add factory method to init builder from an extising configuation Signed-off-by: Chris Laprun <claprun@redhat.com> * fix: remove potentially problematic default implementation Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
No description provided.