generated from quarkiverse/quarkiverse-template
-
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
Treat empty runtime namespaces as All Namespaces mode #658
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkiverse.operatorsdk.runtime; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
|
||
public final class Constants { | ||
private Constants() { | ||
} | ||
|
||
public static final Set<String> QOSDK_USE_BUILDTIME_NAMESPACES_SET = Collections | ||
.singleton(Constants.QOSDK_USE_BUILDTIME_NAMESPACES); | ||
|
||
public static final String QOSDK_USE_BUILDTIME_NAMESPACES = "QOSDK_USE_BUILDTIME_NAMESPACES"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm wondering if it might not just be enough to set the default value to
io.javaoperatorsdk.operator.api.reconciler.Constants.WATCH_ALL_NAMESPACES
here. Ideally, we'd need a test to cover this, actually.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.
If we set the default to WATCH_ALL_NAMESPACES we couldn't tell if there was no specific runtime setting, which means we would always override the build time property.
Maybe the build time property doesn't matter because it's only really intended to affect the manifests and not the runtime behaviour... but at the moment the code will honour the build time property if the runtime property is not set at all.
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 would say that this is the intended behavior but I'm open to change my mind about this depending on what people think. The previous version used the same property for both build and runtimes, which was conducive to confusing which version was used ultimately. With the new
generate-with-watched-namespaces
property, it is now more explicit that the build time value is used mostly for generation purposes. Its value can indeed be propagated at runtime and it's indeed how things are currently implemented, just not sure if it actually make sense since it would make it more difficult to know exactly which configuration is used at runtime. Completely separating both might make more sense with that respect.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.
That was my thinking with a property that was explicitly namespaced with
manifests
in the name to separate it from properties that affect the built image.I feel like the manifests are really runtime configuration and tbh, I think using quarkus.operator-sdk.namespaces at build time should affect the manifests and not the image, and that would make conceptual sense. It breaks the duplicated properties rule though.