Skip to content

Conversation

@anik120
Copy link
Member

@anik120 anik120 commented Jan 29, 2026

Description

This PR implements Phase 2 of the Deployment Configuration RFC: extending the OLMv1 bundle renderer to apply DeploymentConfig customizations to operator deployments.

Building on the foundation from #2454, this PR enables the renderer to accept and apply deployment configuration when rendering registry+v1 bundles. The implementation follows OLMv0's behavior patterns to ensure compatibility and correctness.

The next PR will wire up the config in the ClusterExtension controller by parsing spec.install.config to convert to DeploymentConfig and thread DeploymentConfig through the controller's render call chain

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Copilot AI review requested due to automatic review settings January 29, 2026 21:44
@netlify
Copy link

netlify bot commented Jan 29, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 04b566e
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6980f6c0cbd7160007da60b1
😎 Deploy Preview https://deploy-preview-2469--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.


// DeploymentConfig is a type alias for v1alpha1.SubscriptionConfig
// to maintain clear naming in the OLMv1 context while reusing the v0 type.
type DeploymentConfig = v1alpha1.SubscriptionConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we weren't going to use SubscriptionConfig because of the extra selector field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the RFC:

NOTE: The v0 SubscriptionConfig struct also has a [Selector](https://github.com/operator-framework/api/blob/master/pkg/operators/v1alpha1/subscription_types.go#L47) field, however it is completely ignored by the v0 controller. According to the comment in the code, it was meant to: 
Select which pods/ReplicaSets would receive the subscription’s configuration
Match pod template labels(similar to Deployment selectors) 
However, the code that extracts subscription config overrides(pkg/controller/operators/olm/overrides/config.go) extracts all other fields like NodeSelector, Tolerations, Resources and are subsequently applied, but the Selector field is never extracted. 

OLMv1 will maintain the same behavior—accepting but ignoring this field.

Notice that there's no applySelectorConfig() function, so we're just ignoring that field.

With our wish to reuse v0 SubscriptionConfig for maintainability, we carry over nuance/s into v1. Silently ignoring the selector field being one of them.

We have to remember to document this explicitly for our users everywhere for added clarity.

@anik120 anik120 requested review from Copilot, perdasilva and tmshort and removed request for Copilot and oceanc80 January 29, 2026 21:50
@anik120 anik120 force-pushed the config-api-update-renderer branch from 07bd38a to f8d0a5a Compare January 29, 2026 22:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements Phase 2 of the Deployment Configuration RFC for registry+v1 bundles by threading a DeploymentConfig through the renderer and applying those customizations to CSV-generated Deployment resources (matching OLMv0 behavior), with extensive unit test coverage.

Changes:

  • Add DeploymentConfig support to render.Options and a new render.WithDeploymentConfig(...) option.
  • Apply deployment customizations (env/envFrom, volumes, mounts, tolerations, resources, node selector, affinity, annotations) during registry+v1 CSV Deployment generation.
  • Add/extend unit tests covering option propagation and deployment customization behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/operator-controller/rukpak/render/render.go Adds DeploymentConfig to render options and introduces WithDeploymentConfig.
internal/operator-controller/rukpak/render/render_test.go Adds tests ensuring DeploymentConfig is passed through render options correctly.
internal/operator-controller/rukpak/render/registryv1/generators/generators.go Applies DeploymentConfig to generated CSV Deployment resources via new helper functions.
internal/operator-controller/rukpak/render/registryv1/generators/generators_test.go Adds integration-style tests verifying BundleCSVDeploymentGenerator applies config fields as expected.
internal/operator-controller/rukpak/render/registryv1/generators/deployment_config_test.go Adds unit tests targeting the new config-application helper functions.
internal/operator-controller/config/config.go Introduces a DeploymentConfig alias to v1alpha1.SubscriptionConfig for OLMv1 naming clarity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 86.59794% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.75%. Comparing base (fbe909f) to head (04b566e).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
.../rukpak/render/registryv1/generators/generators.go 86.17% 8 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2469      +/-   ##
==========================================
+ Coverage   69.52%   69.75%   +0.22%     
==========================================
  Files         102      102              
  Lines        8231     8451     +220     
==========================================
+ Hits         5723     5895     +172     
- Misses       2056     2087      +31     
- Partials      452      469      +17     
Flag Coverage Δ
e2e 45.97% <4.12%> (-0.96%) ⬇️
experimental-e2e 13.03% <0.00%> (-0.35%) ⬇️
unit 57.82% <86.59%> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tmshort
Copy link
Contributor

tmshort commented Jan 30, 2026

Lint needs to be fixed.

"github.com/operator-framework/operator-controller/internal/operator-controller/config"
)

func Test_applyCustomConfigToDeployment(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move these tests against the public API?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. WithDeploymentConfig

@anik120 anik120 force-pushed the config-api-update-renderer branch 2 times, most recently from 2c38f50 to 8666d5f Compare February 2, 2026 19:01
Copilot AI review requested due to automatic review settings February 2, 2026 19:01
@anik120 anik120 force-pushed the config-api-update-renderer branch 2 times, most recently from 4d755ab to 4170eae Compare February 2, 2026 19:09
Copy link
Contributor

Copilot AI left a 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 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This PR implements **Phase 2** of the [Deployment Configuration RFC](https://docs.google.com/document/d/18O4qBvu5I4WIJgo5KU1opyUKcrfgk64xsI3tyXxmVEU/edit?tab=t.0):
extending the OLMv1 bundle renderer to apply `DeploymentConfig` customizations to operator deployments.

Building on the foundation from operator-framework#2454, this PR enables the renderer to
accept and apply deployment configuration when rendering registry+v1 bundles.
The implementation follows OLMv0's behavior patterns to ensure compatibility and correctness.

The next PR will wire up the config in the `ClusterExtension` controller by parsing `spec.install.config`
to convert to `DeploymentConfig` and thread `DeploymentConfig` through the controller's render call chain
@anik120 anik120 force-pushed the config-api-update-renderer branch from 4170eae to 04b566e Compare February 2, 2026 19:10
@anik120
Copy link
Member Author

anik120 commented Feb 2, 2026

@perdasilva @tmshort addressed all the feedback, PTAL

@tmshort
Copy link
Contributor

tmshort commented Feb 2, 2026

/approve

@openshift-ci
Copy link

openshift-ci bot commented Feb 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 2, 2026
@perdasilva
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 8daa35d into operator-framework:main Feb 3, 2026
29 checks passed
anik120 added a commit to anik120/operator-controller that referenced this pull request Feb 3, 2026
**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
```
anik120 added a commit to anik120/operator-controller that referenced this pull request Feb 3, 2026
**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
```
anik120 added a commit to anik120/operator-controller that referenced this pull request Feb 3, 2026
**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
```
anik120 added a commit that referenced this pull request Feb 3, 2026
**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)[#2454]: Config API and JSON schema validation
- (PR2469)[#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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants