-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix: runtime namespaces should always override buildtime values #654
Conversation
The previous behavior precluded operator-level defaulting at runtime because setting the `generate-with-watched-namespaces` property was marking the controller as having explicitly set namespaces. We now only set that status if and only if namespaces were set using annotations. Fixes #653
Is it possible to have a variant of this that acts over all controllers? |
Not sure I understand the question |
Will this have to be specified for each controller? |
Using an operator-level default using Before this PR, https://github.com/quarkiverse/quarkus-operator-sdk/blob/main/integration-tests/src/test/java/io/quarkiverse/operatorsdk/it/OperatorSDKResourceTest.java#L117-L135 would fail because the namespaces would be the ones provided at build time. Now, it correctly uses the |
Sorry I mean could a variant of generate-with-watched-namespaces work over all controllers? |
Ah, that's a different issue, which we could indeed support. Can you open a ticket for it, please? Not sure if I'll get to it before my vacations, though. |
This doesn't seem to have worked for me. I built the keycloak operator with:
And run with the env var:
And I got:
Does the runtime property have to be something other than the empty string perhaps? |
Probably, yes, especially if it's set as an env variable because I think an empty value for an env var unsets it. |
An empty envvar is different to an unset one:
|
Although I did a test setting:
and it worked:
However, that doesn't work with OLM. The value OLM passes to tell the operator to watch all namespaces is the empty string, so while this PR helps, its not quite a complete solution to what we need. |
Can you elaborate on this part, please? When you mean OLM, which part of OLM exactly? Can you open another issue with the details, please? I will merge this PR and we'll address other issues in subsequent PRs. |
And, thanks for this part :) |
The previous behavior precluded operator-level defaulting at runtime
because setting the
generate-with-watched-namespaces
property wasmarking the controller as having explicitly set namespaces. We now only
set that status if and only if namespaces were set using annotations.
Fixes #653