🐛 OCPBUGS-76380: fix(deploymentConfig): merge volumes/volumeMounts by name instead of appending#2582
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 |
24ec047 to
95683e5
Compare
There was a problem hiding this comment.
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
volumesandvolumeMountsby 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.
| File | Description |
|---|---|
| test/e2e/features/install.feature | Adds an e2e scenario asserting DeploymentConfig volumes/volumeMounts are applied. |
| internal/operator-controller/rukpak/render/registryv1/generators/generators_test.go | Adds unit tests to validate merge behavior for volumes and volumeMounts. |
| internal/operator-controller/rukpak/render/registryv1/generators/generators.go | Implements 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.
95683e5 to
3dfb483
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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:
|
3dfb483 to
a58546c
Compare
There was a problem hiding this comment.
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.
internal/operator-controller/rukpak/render/registryv1/generators/generators.go
Show resolved
Hide resolved
internal/operator-controller/rukpak/render/registryv1/generators/generators.go
Show resolved
Hide resolved
internal/operator-controller/rukpak/render/registryv1/generators/generators.go
Outdated
Show resolved
Hide resolved
internal/operator-controller/rukpak/render/registryv1/generators/generators.go
Outdated
Show resolved
Hide resolved
…appending Generated-by: Cursour/Claude
a58546c to
6b57386
Compare
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)
After (this fix) — merge-by-name overrides (VALID)
Motivated by: https://redhat.atlassian.net/browse/OCPBUGS-76380