-
Notifications
You must be signed in to change notification settings - Fork 220
fix: same as controller config for KubernetesDependentResource standalone #1222
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
Conversation
Kudos, SonarCloud Quality Gate passed! |
@@ -49,12 +51,17 @@ public KubernetesDependentResource(Class<R> resourceType) { | |||
|
|||
@Override | |||
public void configureWith(KubernetesDependentResourceConfig config) { | |||
configureWith(config.labelSelector(), config.namespaces(), !config.wereNamespacesConfigured()); | |||
this.kubernetesDependentResourceConfig = config; |
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.
Shouldn't we call configureWith(…)
here?
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.
we dont, have the context here, so we don't know the controller namespaces. So it cannot be done at this time.
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.
So when is it done, then? The expectation with the configureWith
methods is that once they're called, the dependent resource is set up. In this case, this isn't true anymore and someone calling this method would need to call one of the other versions at some later time…
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.
see comment below
configureWith(null, context.getControllerConfiguration().getNamespaces(), true); | ||
log.warn("Using default configuration for " + resourceType().getSimpleName() | ||
+ " KubernetesDependentResource, call configureWith to provide configuration"); | ||
if (kubernetesDependentResourceConfig != null) { |
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.
@metacosm it's done here, when the event source is created.
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.
🤔 I saw that but wasn't convinced there wasn't a path where this wouldn't get called… But I guess createEventSource
is always called so we should be good! Thanks!
No description provided.