-
Couldn't load subscription status.
- Fork 68
🐛 OPRUN-4217: OwnNamespace default handling #2283
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
🐛 OPRUN-4217: OwnNamespace default handling #2283
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
5e89c3d to
6d70a32
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2283 +/- ##
==========================================
+ Coverage 71.19% 71.28% +0.09%
==========================================
Files 90 90
Lines 6995 7003 +8
==========================================
+ Hits 4980 4992 +12
+ Misses 1601 1599 -2
+ Partials 414 412 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c798c74 to
20fb0e2
Compare
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.
Pull Request Overview
This PR addresses an issue where bundles with only OwnNamespace support could automatically change install modes during upgrades when AllNamespaces support was added. The fix requires explicit watchNamespace configuration for bundles without AllNamespaces support, preventing unexpected mode changes during upgrades.
Key changes:
- Modified configuration validation to require
watchNamespacewhen AllNamespaces is not supported - Removed defaulting behavior for OwnNamespace-only bundles in the renderer
- Enhanced test coverage for null/empty
watchNamespaceconfigurations
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
internal/operator-controller/rukpak/bundle/config.go |
Updated validation logic to require watchNamespace for non-AllNamespaces bundles and changed nil config handling |
internal/operator-controller/rukpak/render/render.go |
Removed automatic defaulting to install namespace for OwnNamespace-only bundles |
internal/operator-controller/applier/provider.go |
Updated to use new ExtensionConfigBytes() method and apply validation for all SingleOwnNamespace cases |
api/v1/clusterextension_types.go |
Added ExtensionConfigBytes() helper method to retrieve user configuration |
test/experimental-e2e/single_namespace_support_test.go |
Added comprehensive e2e tests for SingleNamespace and OwnNamespace install modes with configuration validation |
internal/operator-controller/rukpak/render/render_test.go |
Added unit tests covering default target namespace behavior for various install mode combinations |
internal/operator-controller/rukpak/bundle/config_test.go |
Expanded tests for null/missing watchNamespace configurations and validation errors |
testdata/images/bundles/* |
Added fixtures for single-namespace-operator and own-namespace-operator test bundles |
testdata/images/catalogs/test-catalog/v1/configs/catalog.yaml |
Added catalog entries for new test operators |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...ingle-namespace-operator/v1.0.0/manifests/singlenamespaceoperator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
...ingle-namespace-operator/v1.0.0/manifests/singlenamespaceoperator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
...dles/own-namespace-operator/v1.0.0/manifests/ownnamespaceoperator.clusterserviceversion.yaml
Show resolved
Hide resolved
2a716d7 to
8034767
Compare
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.
Pull Request Overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8034767 to
443d7a2
Compare
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.
Pull Request Overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...dles/own-namespace-operator/v1.0.0/manifests/ownnamespaceoperator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
4b37d8c to
0ea85d7
Compare
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.
Pull Request Overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0ea85d7 to
a02080d
Compare
e392d2b to
55bdb12
Compare
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.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
55bdb12 to
d927b43
Compare
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
d927b43 to
f995320
Compare
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.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
I've removed that and made it a private utility closer to where it is used |
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.
It seems solid for me, LGTM
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8b6debd
into
operator-framework:main
Description
Currently, if a bundle only supports OwnNamespace the
watchNamespaceconfiguration will no be present for that bundle and the bundle will be automatically installed in OwnNamespace mode (by setting the targetNamespaces to the install namespace). While this is intuitive and makes life easier for the user, it can can lead to a break in default behavior if the package decided to add AllNamespaces support. For instance:v1 only supports OwnNamespace install mode. The ClusterExtension has no configuration so the bundle is installed in OwnNamespace mode.
v1.1 adds AllNamespaces support and the ClusterExtension detects the upgrade and initiates it. The default is now AllNamespaces mode. So, the operator is now installed in AllNamespace mode without knowledge or acceptance by the user.
To address this issue, we modify the defaulting and configuration behavior for this case by requiring
watchNamespaceto be set and removing the defaulting behavior, i.e. making it undefined. I.e. only bundles with AllNamespaces mode can be installed withoutwatchNamespaceconfiguration. This means that when v2 comes out with AllNamespaces support, the configuration will already be present in the ClusterExtension and v2 will be installed in the same mode. The user can then remove the configuration if they wish to change install modes.So, in this PR, we:
ExtensionConfigBytes()method toClusterExtensionto easily grab user configurationUnmarshalConfigto treatnilas{}to force schema validation (catch missing required values, etc.)RegistryV1ManifestProvidertests to ensure bundle configuration is being properly validatedReviewer Checklist