📖 Bundle Deployment Configuration#2528
📖 Bundle Deployment Configuration#2528anik120 wants to merge 1 commit intooperator-framework:mainfrom
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive documentation for the Bundle Deployment Configuration feature, which enables users to customize operator deployment settings in OLMv1. The feature provides parity with OLMv0's Subscription.spec.config functionality, allowing customization of resource requirements, node placement, environment variables, storage, and annotations.
Changes:
- Added detailed documentation explaining the Bundle Deployment Configuration feature and its use cases
- Provided configuration examples for environment variables, resources, node placement (selectors, tolerations, affinity), storage, and annotations
- Included migration guide from OLM v0 to OLM v1
- Documented validation schema generation and error handling
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| config: | ||
| inline: |
There was a problem hiding this comment.
The config examples are missing the required configType field. According to the ClusterExtension API definition (api/v1/clusterextension_types.go), the config.configType field is required and must be set to "Inline" when using inline configuration. All examples should include configType: Inline before the inline: field.
| config: | ||
| env: |
There was a problem hiding this comment.
The config examples are missing the required configType field. According to the ClusterExtension API definition (api/v1/clusterextension_types.go), the config.configType field is required and must be set to "Inline" when using inline configuration. All examples should include configType: Inline before the inline: field.
| custom.annotation/key: "value" | ||
| ``` | ||
|
|
||
| **Behavior**: Annotations are merged with existing annotations. If the same annotation key exists in both the bundle and the configuration, the bundle's annotation value takes precedence. |
There was a problem hiding this comment.
The behavior description for annotations is incorrect. According to the implementation in internal/operator-controller/rukpak/render/registryv1/generators/generators.go lines 772-796, existing deployment and pod annotations take precedence over config annotations (no override). The documentation states the opposite - that "the bundle's annotation value takes precedence". The correct behavior is that annotations from the bundle are NOT overridden by the deploymentConfig annotations.
| **Behavior**: Annotations are merged with existing annotations. If the same annotation key exists in both the bundle and the configuration, the bundle's annotation value takes precedence. | |
| **Behavior**: Annotations are merged with existing annotations. If the same annotation key exists in both the bundle and the `deploymentConfig`, the existing annotation from the bundle is preserved and the `deploymentConfig` value is ignored. |
| config: | ||
| inline: |
There was a problem hiding this comment.
The config examples are missing the required configType field. According to the ClusterExtension API definition (api/v1/clusterextension_types.go), the config.configType field is required and must be set to "Inline" when using inline configuration. All examples should include configType: Inline before the inline: field.
| catalog: | ||
| packageName: my-operator | ||
| channel: stable | ||
| config: |
There was a problem hiding this comment.
The config examples are missing the required configType field. According to the ClusterExtension API definition (api/v1/clusterextension_types.go), the config.configType field is required and must be set to "Inline" when using inline configuration. All examples should include configType: Inline before the inline: field.
| config: | |
| config: | |
| configType: Inline |
| config: | ||
| inline: |
There was a problem hiding this comment.
The config examples are missing the required configType field. According to the ClusterExtension API definition (api/v1/clusterextension_types.go), the config.configType field is required and must be set to "Inline" when using inline configuration. All examples should include configType: Inline before the inline: field.
| catalog: | ||
| packageName: production-operator | ||
| version: 1.2.3 | ||
| config: |
There was a problem hiding this comment.
The config examples are missing the required configType field. According to the ClusterExtension API definition (api/v1/clusterextension_types.go), the config.configType field is required and must be set to "Inline" when using inline configuration. All examples should include configType: Inline before the inline: field.
| config: | |
| config: | |
| configType: Inline |
| !!! note | ||
| This feature is still in `alpha` and the `DeploymentConfig` feature gate must be enabled to make use of it. | ||
| See the instructions below on how to enable it. |
There was a problem hiding this comment.
The note incorrectly states that the DeploymentConfig feature gate must be enabled. No such feature gate exists in the codebase (verified in internal/operator-controller/features/features.go). The deploymentConfig functionality appears to be available by default without any feature gate requirement.
| ## Enabling the Feature Gate | ||
|
|
||
| To enable the Bundle Deployment Configuration feature gate, you need to patch the `operator-controller-controller-manager` deployment in the `olmv1-system` namespace. This will add the `--feature-gates=DeploymentConfig=true` argument to the manager container. | ||
|
|
||
| 1. **Patch the deployment:** | ||
|
|
||
| ```bash | ||
| kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=DeploymentConfig=true"}]' | ||
| ``` | ||
|
|
||
| 2. **Wait for the controller manager pods to be ready:** | ||
|
|
||
| ```bash | ||
| kubectl -n olmv1-system wait --for=condition=ready pods -l app.kubernetes.io/name=operator-controller | ||
| ``` | ||
|
|
||
| Once the above wait condition is met, the `DeploymentConfig` feature gate should be enabled in operator-controller. |
There was a problem hiding this comment.
The documentation incorrectly states that a DeploymentConfig feature gate must be enabled. After reviewing the codebase, no such feature gate exists in internal/operator-controller/features/features.go. The deploymentConfig functionality appears to be always available in the registry+v1 bundle config schema (internal/operator-controller/rukpak/bundle/registryv1.go) without any feature gate requirement. This entire section about enabling the feature gate should be removed or corrected.
|
|
||
| ## Migration from OLM v0 | ||
|
|
||
| If you're migrating from OLM v0, you can directly transfer your `Subscription.spec.config` settings to the `deploymentConfig` object within `ClusterExtension.spec.config.inline`. The structure is identical. |
There was a problem hiding this comment.
The statement "The structure is identical" could be clearer. While the structure of the configuration fields (env, resources, etc.) is identical, the location differs: in OLM v0 these fields are directly under Subscription.spec.config, whereas in OLM v1 they're nested under ClusterExtension.spec.config.inline.deploymentConfig. Consider rephrasing to: "The structure of the configuration fields is identical - simply nest your Subscription.spec.config settings under the deploymentConfig key within ClusterExtension.spec.config.inline."
| If you're migrating from OLM v0, you can directly transfer your `Subscription.spec.config` settings to the `deploymentConfig` object within `ClusterExtension.spec.config.inline`. The structure is identical. | |
| If you're migrating from OLM v0, the structure of the configuration fields is identical — simply nest your `Subscription.spec.config` settings under the `deploymentConfig` key within `ClusterExtension.spec.config.inline`. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2528 +/- ##
==========================================
- Coverage 72.04% 72.00% -0.05%
==========================================
Files 103 103
Lines 8690 8690
==========================================
- Hits 6261 6257 -4
- Misses 1946 1948 +2
- Partials 483 485 +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:
|
Description
Reviewer Checklist