-
Notifications
You must be signed in to change notification settings - Fork 71
✨Extract and pass deploymentConfig to bundle renderer #2482
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
✨Extract and pass deploymentConfig to bundle renderer #2482
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 completes Phase 3 of the Deployment Configuration RFC, enabling users to customize operator deployments through the ClusterExtension spec. It extracts validated deploymentConfig from the bundle configuration and passes it to the renderer for application to operator deployments.
Changes:
- Added extraction logic to get
deploymentConfigfrom validated bundle configuration - Implemented conversion from map to
DeploymentConfigstruct via JSON marshaling - Added comprehensive test coverage for various deploymentConfig scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/operator-controller/applier/provider.go | Added deploymentConfig extraction and conversion logic in Get method; implemented convertToDeploymentConfig helper function |
| internal/operator-controller/applier/provider_test.go | Added 4 test cases covering deploymentConfig with single field, no config, multiple fields, and combination with watchNamespace |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2482 +/- ##
==========================================
- Coverage 73.73% 69.76% -3.97%
==========================================
Files 102 102
Lines 8451 8473 +22
==========================================
- Hits 6231 5911 -320
- Misses 1741 2090 +349
+ Partials 479 472 -7
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:
|
1d4703f to
278d27f
Compare
**Summary** Completes Phase 3 of the [Deployment Configuration RFC](https://docs.google.com/document/d/1bDo3W1asZqjJTgZy7BcVOGtKOEukp0vUi5CO1ac3vwc/edit?usp=sharing). Extracts `deploymentConfig` from validated ClusterExtension configuration and passes it to the bundle renderer. Builds on: - (PR2454)[operator-framework#2454]: Config API and JSON schema validation - (PR2469)[operator-framework#2469]: Renderer support for applying deployment customizations This completes the RFC - users can now customize operator deployments via ClusterExtension.spec.config.inline: ``` config: configType: Inline inline: watchNamespace: "some-namespace" deploymentConfig: env: - name: TEST_ENV value: test-value nodeSelector: kubernetes.io/os: linux ```
278d27f to
d7cb702
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 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if err != nil { | ||
| return nil, errorutil.NewTerminalError(ocv1.ReasonInvalidConfiguration, fmt.Errorf("invalid deploymentConfig: %w", err)) | ||
| } | ||
| opts = append(opts, render.WithDeploymentConfig(deploymentConfig)) |
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 happens when deploymentConfig is nil (i.e. first return case. of return nil, nil?
| ResourceGenerators: []render.ResourceGenerator{ | ||
| func(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error) { | ||
| t.Log("ensure deploymentConfig is nil for empty config object") | ||
| require.Nil(t, opts.DeploymentConfig) |
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.
Although, you do seem to test it here.
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Completes Phase 3 of the Deployment Configuration RFC. Extracts
deploymentConfigfrom validated ClusterExtension configuration and passes it to the bundle renderer.Builds on:
This completes the RFC - users can now customize operator deployments via
ClusterExtension.spec.config.inline:Description
Reviewer Checklist