-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
internal/pkg/scaffold/olm-catalog: use olm.targetNamespaces annotation in WATCH_NAMESPACE #1396
internal/pkg/scaffold/olm-catalog: use olm.targetNamespaces annotation in WATCH_NAMESPACE #1396
Conversation
…spaces annotation in WATCH_NAMESPACE
56ae2d7
to
dc9ad7c
Compare
@estroz I am running into this too - any chance to get this landed ? |
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 it fixes the problem for the users we should merge this asap 👍 lgtm
Couple of questions but nothing blocking.
// check that depHasOLMNamespaces() returns false. | ||
dep := &appsv1.Deployment{} | ||
if err := yaml.Unmarshal(depBytes, dep); err != nil { | ||
t.Fatalf("(1) Failed to unmarshal Deployment bytes: %v", err) |
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 does the (1) here signify?
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.
Artifact from testing. Removed.
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.
LGTM
@estroz If this considered a bug fix in csv-gen
then we should add it to the CHANGELOG.
…n in WATCH_NAMESPACE (operator-framework#1396) * internal/pkg/scaffold/olm-catalog/csv_updaters.go: use olm.targetNamespaces annotation in WATCH_NAMESPACE, and add unit tests * CHANGELOG.md: add CSV WATCH_NAMESPACE update
…n in WATCH_NAMESPACE (operator-framework#1396) * internal/pkg/scaffold/olm-catalog/csv_updaters.go: use olm.targetNamespaces annotation in WATCH_NAMESPACE, and add unit tests * CHANGELOG.md: add CSV WATCH_NAMESPACE update
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] - instead of the olf fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] - instead of the olf fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] - instead of the olf fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] - instead of the olf fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] - instead of the olf fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - spec.apiservicedefinitions explicitely set as empty hash. This is what is done in operator-sdk new projects too - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - fix version of the CSV from 0.3.0 to 0.0.0 - modification of some description fields - minor format changes
Changes: - metadata.alm-examples section is indented/pretty-printed now - the spec.install.spec.deployments.spec section sets the WATCH_NAMESPACE to fieldPath: metadata.annotations['olm.targetNamespaces'] instead of the old fieldPath: metadata.namespace. This is a change introduced in operator-sdk v0.8.2. More information about this: operator-framework/operator-sdk#1396 - updated the role section with the current contents of deploy/role.yaml - modification of some description fields - minor format changes
Description of the change: reference
olm.targetNamespaces
frommetadata.annotations
forWATCH_NAMESPACE
in a CSV's install plan.Motivation for the change: OLM determines the namespace(s) in which an operator is deployed, and places these in
metadata.annotations.olm.targetNamespaces
.WATCH_NAMESPACE
will only be updated if the env var field reference is updated as it is in this PR. See the OperatorGroup docs for more details.Note: OLM supports multiple namespaces but the SDK will not until we bump
controller-runtime
to v0.2.0. However,gen-csv
setsMultiNamespace
support tofalse
by default soWATCH_NAMESPACE
will only contain one namespace until the bump.Closes #1360