Skip to content

🐛 OCPBUGS-76380: fix(deploymentConfig): merge volumes/volumeMounts by name instead of appending - #2582

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
camilamacedo86:fix-duplicate
Mar 24, 2026
Merged

🐛 OCPBUGS-76380: fix(deploymentConfig): merge volumes/volumeMounts by name instead of appending#2582
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
camilamacedo86:fix-duplicate

Conversation

@camilamacedo86

@camilamacedo86camilamacedo86 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Problem
When a ClusterExtension’s deploymentConfig defined volumes or volumeMounts with names that already existed in the bundle’s CSV deployment, the implementation would simply append them. This caused duplicate entries with identical names, which is invalid in Kubernetes since volume and volumeMount names must be unique within a pod spec.

Solution
Switch from a naive append approach to a merge-by-name strategy. If a volume or volumeMount from the deploymentConfig matches an existing one by name, it replaces the original entry instead of creating a duplicate. Entries with new names are appended as usual.

This PR implements the same behvaiour of OLMv0 , see:

Example

Before (on main) — append causes duplicates (INVALID)

volumes:
- name: "data-vol"emptyDir: {}
- name: "data-vol"# DUPLICATE! Kubernetes rejects this.configMap:
name: "my-configmap"volumeMounts:
- name: "data-vol"mountPath: "/old/path"
- name: "data-vol"# DUPLICATE!mountPath: "/new/path"

After (this fix) — merge-by-name overrides (VALID)

volumes:
- name: "data-vol" # Overridden in place by the config value
configMap:
name: "my-configmap"
volumeMounts:
- name: "data-vol" # Overridden in place
mountPath: "/new/path"

Motivated by: https://redhat.atlassian.net/browse/OCPBUGS-76380

CopilotAI review requested due to automatic review settings March 20, 2026 14:41
@netlify

netlifyBot commented Mar 20, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit6b57386
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/69c16cf33ece1500089b8a60
😎 Deploy Previewhttps://deploy-preview-2582--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.

@camilamacedo86camilamacedo86 changed the title 🐛 fix(deploymentConfig): merge volumes/volumeMounts by name instead of appending🐛 OCPBUGS-76380: fix(deploymentConfig): merge volumes/volumeMounts by name instead of appendingMar 20, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 updates the operator-controller’s DeploymentConfig rendering logic to merge volumes and volumeMounts by name (overriding existing entries) rather than blindly appending, aligning behavior with legacy OLM injection semantics. It also adds unit and e2e coverage around the expected volume/volumeMount application.

Changes:

  • Change DeploymentConfig rendering to merge volumes and volumeMounts by name (override on collision).
  • Add unit tests verifying override-vs-append behavior for volumes and volumeMounts.
  • Add an e2e scenario intended to validate that configured volumes/volumeMounts appear on the operator Deployment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
test/e2e/features/install.featureAdds an e2e scenario asserting DeploymentConfig volumes/volumeMounts are applied.
internal/operator-controller/rukpak/render/registryv1/generators/generators_test.goAdds unit tests to validate merge behavior for volumes and volumeMounts.
internal/operator-controller/rukpak/render/registryv1/generators/generators.goImplements merge-by-name logic for volumes and volumeMounts and wires it into DeploymentConfig application.

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

Comment threadtest/e2e/features/install.feature Outdated
@codecov

codecovBot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.78%. Comparing base (a307a6d) to head (6b57386).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #2582 +/- ##
==========================================
+ Coverage 65.84% 67.78% +1.94% 
==========================================
Files 137 137 Lines 9560 9574 +14 ==========================================
+ Hits 6295 6490 +195 + Misses 2795 2585 -210 - Partials 470 499 +29 
FlagCoverage Δ
e2e38.10% <0.00%> (+26.91%)⬆️
experimental-e2e50.95% <0.00%> (-0.12%)⬇️
unit52.87% <100.00%> (+0.06%)⬆️

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.

CopilotAI review requested due to automatic review settings March 23, 2026 13:19

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 4 comments.


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

@pedjakpedjak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Mar 23, 2026
@tmshort

Copy link
Copy Markdown
Contributor

/approve

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 24, 2026

@rashmigottipatirashmigottipati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rashmigottipati, 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-merge-bot
openshift-merge-botBot merged commit 627ce43 into operator-framework:mainMar 24, 2026
26 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@camilamacedo86@tmshort@pedjak@rashmigottipati