-
Notifications
You must be signed in to change notification settings - Fork 50
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: add proper default install mode derived from watched namespaces #841
base: main
Are you sure you want to change the base?
Conversation
35df666
to
f45b978
Compare
@@ -49,6 +48,13 @@ public void shouldWriteBundleForTheOperators() throws IOException { | |||
assertEquals(FirstReconciler.REPLACES, csv.getSpec().getReplaces()); | |||
var bundleMeta = getAnnotationsFor(bundle, "first-operator"); | |||
assertEquals(BUNDLE_PACKAGE, bundleMeta.getAnnotations().get("operators.operatorframework.io.bundle.package.v1")); | |||
assertEquals(2, csv.getSpec().getInstallModes().size()); | |||
var installMode = csv.getSpec().getInstallModes().get(0); | |||
assertEquals("AllNamespaces", installMode.getType()); |
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 could use the constants here too? I don't think this will change so not blocking this PR.
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 always debating whether or not to use constants in the tests, especially when the tests are checking compatibility with an external service or spec. In this case, if we used a constant, and the constant value changed but not the external spec, then the test would still pass even though it would now output incorrect values.
@@ -5,7 +5,7 @@ | |||
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; | |||
import io.quarkiverse.operatorsdk.annotations.CSVMetadata; | |||
|
|||
@CSVMetadata(name = "first-operator", version = FirstReconciler.VERSION) | |||
@CSVMetadata(name = "first-operator", version = FirstReconciler.VERSION, installModes = @CSVMetadata.InstallMode(type = "MultiNamespace", supported = false)) |
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.
Maybe there should be a public wrapper around the allowed type values.
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.
Do you mean like an enum or something like that?
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.
yes, something that we can point users to.
Fixes #839 Signed-off-by: Chris Laprun <[email protected]>
f45b978
to
1f36645
Compare
Looks like the install mode is not supported: https://github.com/quarkiverse/quarkus-operator-sdk/actions/runs/10471449036/job/28998782965#step:32:134 |
Fixes #839
Signed-off-by: Chris Laprun [email protected]