-
Notifications
You must be signed in to change notification settings - Fork 217
feat: allow reconcilers to override their own configuration #2779
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use case for this change?
Would be good to document it at least as Javadoc on the interface
This allows for |
Signed-off-by: Chris Laprun <claprun@redhat.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
dafb814
to
fa23191
Compare
I like this approach. It will definitely make my life easier where I have many label selectors that I'm adjusting based on two sources: a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing I don't understand is why it's not applied the first time getConfigurationFor
is called.
I see thank you, makes sense, just some remarks: Just for the record: In general in v5 we aimed to remove interface implementation for reconciler since are not easy to discover. However since this is mainly intended for the extension (quarkus/SB) I think it is better to do this way as it is then having it as a default method on reconciler interface. What however, might be considered as an alternative ( and let me know this if this is also feasible on Quarkus side), I'm quite sure this would work in SB, but can prepare a prototype; is this: To not bake this mechanism into the core, rather have this interface in the extensions only, and provide it as a bean: @Singleton
@ForController(MyController.class)
@ForController(MyOtherController.class)
public class MyConfigOverrode implements ConfigurableReconciler {
@Inject
Object anyBeanOrRuntimeValue
void updateConfigurationFrom(ControllerConfigurationOverrider configOverrider) {
// my code to use override, possibly using runtime injected beans.
}
} Then is bean instance could be easily used with the current API when the reconciler is registered in the background. Note the Can expand on this later, hope it is clear how I mean it. Pls let me know what do you think. The pros is that we don't have to introduce an other construct to the core, also might be a more flexible approach for the users (maybe with a more modern API? ). On the other hand the config is not tightly coupled with the reconciler (which might be a good and also a bad thing). |
Signed-off-by: Chris Laprun claprun@redhat.com