Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
627ce43
fix(deploymentConfig): merge volumes/volumeMounts by name instead of …
camilamacedo86 Mar 24, 2026
c16a97b
:seedling: Bump golang.org/x/mod from 0.33.0 to 0.34.0 (#2588)
dependabot[bot] Mar 24, 2026
6390e73
Merge branch 'main' into synchronize
Mar 24, 2026
54be5a8
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
8bd41b7
UPSTREAM: <carry>: Add new tests for single/own namespaces install modes
camilamacedo86 Oct 6, 2025
eda0eff
UPSTREAM: <carry>: Upgrade OCP image from 4.20 to 4.21
camilamacedo86 Oct 13, 2025
108db80
UPSTREAM: <carry>: [Default Catalog Tests] - Change logic to get ocp …
camilamacedo86 Oct 13, 2025
6e70d9f
UPSTREAM: <carry>: Update OCP catalogs to v4.21
tmshort Oct 13, 2025
c5d2431
UPSTREAM: <carry>: support singleown cases in disconnected
kuiwang02 Oct 16, 2025
df04761
UPSTREAM: <carry>: fix cases 81696 and 74618 for product code changes
kuiwang02 Oct 17, 2025
a4eb3db
UPSTREAM: <carry>: Define Default timeouts and apply their usage accr…
camilamacedo86 Oct 22, 2025
5488e4b
UPSTREAM: <carry>: Update to new feature-gate options in helm
tmshort Oct 22, 2025
586165b
UPSTREAM: <carry>: Fix flake for single/own ns tests by ensuring uniq…
camilamacedo86 Oct 22, 2025
b6bb35f
UPSTREAM: <carry>: [OTE]: Enhance single/own ns based on review comme…
camilamacedo86 Oct 24, 2025
34b59fd
UPSTREAM: <carry>: Update OwnSingle template to use spec.config.inlin…
kuiwang02 Nov 3, 2025
7ca3621
UPSTREAM: <carry>: [OTE]: Add webhook cleanup validation on extension…
camilamacedo86 Nov 4, 2025
e2f7e6a
UPSTREAM: <carry>: Add [OTP] to migrated cases
kuiwang02 Nov 7, 2025
3a2706b
UPSTREAM: <carry>: [OTE]: Upgrade dependencies used
camilamacedo86 Nov 5, 2025
969ee5f
UPSTREAM: <carry>: fix(OTE): fix OpenShift Kubernetes replace version…
camilamacedo86 Nov 10, 2025
2146ed2
UPSTREAM: <carry>: [Default Catalog Tests] Upgrade go 1.24.6 and depe…
camilamacedo86 Nov 11, 2025
d930e97
UPSTREAM: <carry>: add disconnected environment support with custom p…
kuiwang02 Nov 12, 2025
55bee54
UPSTREAM: <carry>: migrate jiazha test cases to OTE
jianzhangbjz Nov 14, 2025
b734388
UPSTREAM: <carry>: migrate clustercatalog case to ote
Xia-Zhao-rh Oct 17, 2025
90d4eb9
UPSTREAM: <carry>: migrate olmv1 QE stress cases
kuiwang02 Nov 20, 2025
a0c87c5
UPSTREAM: <carry>: Use busybox/httpd to simulate probes
tmshort Nov 25, 2025
baf467f
UPSTREAM: <carry>: migrate olmv1 QE cases
Xia-Zhao-rh Nov 25, 2025
fe122c7
UPSTREAM: <carry>: add agent for olmv1 qe cases
kuiwang02 Oct 21, 2025
56d197d
UPSTREAM: <carry>: Disable upstream PodDisruptionBudget
tmshort Dec 3, 2025
4fec5cb
UPSTREAM: <carry>: Add AGENTS.md for AI code contributions
rashmigottipati Dec 11, 2025
8c64795
UPSTREAM: <carry>: address review comments through addl prompts
rashmigottipati Dec 11, 2025
7f4584d
UPSTREAM: <carry>: addressing some more review comments
rashmigottipati Dec 11, 2025
bad75e4
UPSTREAM: <carry>: remove DCO line
rashmigottipati Dec 11, 2025
390b226
UPSTREAM: <carry>: migrate bandrade test cases to OTE
bandrade Nov 18, 2025
fbf15c1
UPSTREAM: <carry>: update metadata
bandrade Dec 3, 2025
2bc1eeb
UPSTREAM: <carry>: remove originalName
bandrade Dec 3, 2025
a45059a
UPSTREAM: <carry>: update 80458's timeout to 180s
jianzhangbjz Dec 8, 2025
e1f7cb1
UPSTREAM: <carry>: update 83026 to specify the clustercatalog
jianzhangbjz Dec 15, 2025
be6a545
UPSTREAM: <carry>: Update to golang 1.25 and ocp 4.22
oceanc80 Dec 18, 2025
0ce0719
UPSTREAM: <carry>: Use oc client for running e2e tests
pedjak Jan 13, 2026
2cf30c4
UPSTREAM: <carry>: Run upstream e2e tests tagged with `@catalogd-update`
pedjak Jan 14, 2026
ef769eb
UPSTREAM: <carry>: enhance case to make it more stable
kuiwang02 Jan 6, 2026
897bd48
UPSTREAM: <carry>: add service account to curl job
ehearne-redhat Jan 7, 2026
3889b42
UPSTREAM: <carry>: move sa creation out of buildCurlJob()
ehearne-redhat Jan 8, 2026
598aafb
UPSTREAM: <carry>: comment out delete service account
ehearne-redhat Jan 9, 2026
d784f55
UPSTREAM: <carry>: move defercleanup for sa for LIFO
ehearne-redhat Jan 9, 2026
0d9817a
UPSTREAM: <carry>: add polling so job fully deleted before proceed
ehearne-redhat Jan 12, 2026
557780b
UPSTREAM: <carry>: Revert "Merge pull request #594 from ehearne-redha…
sosiouxme Jan 20, 2026
08d737c
UPSTREAM: <carry>: Remove openshift-redhat-marketplace catalog tests
camilamacedo86 Jan 8, 2026
fb76190
UPSTREAM: <carry>: config watchnamespace cases
kuiwang02 Jan 6, 2026
642797a
UPSTREAM: <carry>: enhance ocp-79770
Xia-Zhao-rh Jan 26, 2026
6a01789
UPSTREAM: <carry>: upgrade version support case
kuiwang02 Jan 28, 2026
05ac96a
UPSTREAM: <carry>: Remove installed condition check from auth preflig…
Jan 30, 2026
d8f4295
UPSTREAM: <carry>: Add openshift/api dependency
Jan 30, 2026
94bc022
UPSTREAM: <carry>: Add boxcutter specific preflight auth test
Jan 30, 2026
2846272
UPSTREAM: <carry>: adjust watchnamespace case based on change
kuiwang02 Feb 2, 2026
b1bb681
UPSTREAM: <carry>: fix(ote): Use as operator-controller dep from root…
camilamacedo86 Feb 3, 2026
0c11257
UPSTREAM: <carry>: add 83979 automation
bandrade Feb 2, 2026
77462b1
UPSTREAM: <carry>: add 85889 automation
bandrade Feb 2, 2026
2875b63
UPSTREAM: <carry>: Update test-operator startup script to fix pod pro…
Feb 4, 2026
59697d4
UPSTREAM: <carry>: Fix up own-namespace invalid configuration test
Feb 7, 2026
b4511a7
UPSTREAM: <carry>: Preflight tests use in-cluster catalog and bundles…
camilamacedo86 Feb 24, 2026
b176b0f
UPSTREAM: <carry>: adjust sa and permission test cases per new change…
kuiwang02 Feb 2, 2026
1ae3a95
UPSTREAM: <carry>: Update OCP catalogs to v4.22
camilamacedo86 Feb 3, 2026
a64ef26
UPSTREAM: <carry>: chore(OTE and Default Catalog Tests) Update go and…
camilamacedo86 Feb 26, 2026
88cd537
UPSTREAM: <carry>: fix 83026 for TP cluster
jianzhangbjz Feb 28, 2026
ec8e217
UPSTREAM: <carry>: serviceAccount validation unified across all runtimes
kuiwang02 Mar 6, 2026
e16ccd4
UPSTREAM: <carry>: Fix OLMv1 test operator to listen on IPv6
stbenjam Mar 6, 2026
7c7c225
UPSTREAM: <carry>: Increase install timeout and add diagnostic loggin…
camilamacedo86 Mar 11, 2026
bf99050
UPSTREAM: <carry>: add service account to curl job
ehearne-redhat Mar 2, 2026
8171741
UPSTREAM: <carry>: update OCP-75441 to support multi-arch
jianzhangbjz Mar 19, 2026
d8a2ac8
UPSTREAM: <carry>: deployment config cases
kuiwang02 Feb 6, 2026
f4659a4
UPSTREAM: <carry>: Add OTE tests for OLMv1 DeploymentConfig support
tmshort Mar 11, 2026
a7219af
UPSTREAM: <carry>: Update openshift/api and client-go
tmshort Mar 19, 2026
c8938a3
UPSTREAM: <carry>: Add boxcutter tests
camilamacedo86 Mar 23, 2026
fbcad82
UPSTREAM: <drop>: go mod vendor
Mar 24, 2026
f93ce6f
UPSTREAM: <drop>: remove upstream GitHub configuration
Mar 24, 2026
de842db
UPSTREAM: <drop>: configure the commit-checker
Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expectedMergeBase: a307a6daf5c5b1bd78c75e0ed02aeaf5c7f9d94d
expectedMergeBase: c16a97bc1853e36955b4e1825b8e8ecea565f69a
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/stretchr/testify v1.11.1
go.podman.io/image/v5 v5.39.1
golang.org/x/exp v0.0.0-20260209203927-2842357ff358
golang.org/x/mod v0.33.0
golang.org/x/mod v0.34.0
golang.org/x/sync v0.20.0
golang.org/x/tools v0.42.0
helm.sh/helm/v3 v3.20.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,19 +671,32 @@ func applyEnvironmentFromConfig(deployment *appsv1.Deployment, config *config.De
}
}

// applyVolumeConfig appends volumes to the deployment's pod spec.
// This follows OLMv0 behavior:
// applyVolumeConfig merges volumes into the deployment's pod spec.
// Volumes from config override existing volumes with the same name.
// This differs from OLMv0, which appends volumes without checking for duplicates:
// https://github.com/operator-framework/operator-lifecycle-manager/blob/v0.39.0/pkg/controller/operators/olm/overrides/inject/inject.go#L104-L117
func applyVolumeConfig(deployment *appsv1.Deployment, config *config.DeploymentConfig) {
if len(config.Volumes) == 0 {
return
}

deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, config.Volumes...)
existingVolMap := make(map[string]int, len(deployment.Spec.Template.Spec.Volumes))
for i, vol := range deployment.Spec.Template.Spec.Volumes {
existingVolMap[vol.Name] = i
}

for _, configVol := range config.Volumes {
if idx, exists := existingVolMap[configVol.Name]; exists {
deployment.Spec.Template.Spec.Volumes[idx] = configVol
} else {
deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, configVol)
}
}
Comment on lines +683 to +694
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update merge-index maps after append to prevent duplicate-name insertion

At Line 688 and Line 714 loops, newly appended entries are not recorded in the lookup maps. Duplicate names inside DeploymentConfig will be appended multiple times instead of being merged; for volumes this can yield an invalid pod spec.

Proposed fix
 func applyVolumeConfig(deployment *appsv1.Deployment, config *config.DeploymentConfig) {
@@
 	for _, configVol := range config.Volumes {
 		if idx, exists := existingVolMap[configVol.Name]; exists {
 			deployment.Spec.Template.Spec.Volumes[idx] = configVol
 		} else {
 			deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, configVol)
+			existingVolMap[configVol.Name] = len(deployment.Spec.Template.Spec.Volumes) - 1
 		}
 	}
 }
@@
 		for _, configMount := range config.VolumeMounts {
 			if idx, exists := existingMountMap[configMount.Name]; exists {
 				container.VolumeMounts[idx] = configMount
 			} else {
 				container.VolumeMounts = append(container.VolumeMounts, configMount)
+				existingMountMap[configMount.Name] = len(container.VolumeMounts) - 1
 			}
 		}
 	}
 }

Also applies to: 709-720

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@internal/operator-controller/rukpak/render/registryv1/generators/generators.go`
around lines 683 - 694, The merge logic for volumes uses existingVolMap to
replace matching volumes but does not update the map when a new volume is
appended, so duplicate-named volumes from config.Volumes can be appended
repeatedly; after appending configVol to deployment.Spec.Template.Spec.Volumes
in the loop, add an entry to existingVolMap keyed by configVol.Name with the new
index (len(deployment.Spec.Template.Spec.Volumes)-1) so subsequent iterations
will find and merge the newly appended volume; apply the same pattern to the
other merge-index maps used in the surrounding loops (e.g., for mounts/envs) to
prevent duplicate insertion.

}

// applyVolumeMountConfig appends volume mounts to all containers in the deployment.
// This follows OLMv0 behavior:
// applyVolumeMountConfig merges volume mounts into all containers in the deployment.
// Volume mounts from config override existing volume mounts with the same name.
// This differs from OLMv0, which appends volume mounts without checking for duplicates:
// https://github.com/operator-framework/operator-lifecycle-manager/blob/v0.39.0/pkg/controller/operators/olm/overrides/inject/inject.go#L149-L165
func applyVolumeMountConfig(deployment *appsv1.Deployment, config *config.DeploymentConfig) {
if len(config.VolumeMounts) == 0 {
Expand All @@ -692,7 +705,19 @@ func applyVolumeMountConfig(deployment *appsv1.Deployment, config *config.Deploy

for i := range deployment.Spec.Template.Spec.Containers {
container := &deployment.Spec.Template.Spec.Containers[i]
container.VolumeMounts = append(container.VolumeMounts, config.VolumeMounts...)

existingMountMap := make(map[string]int, len(container.VolumeMounts))
for idx, mount := range container.VolumeMounts {
existingMountMap[mount.Name] = idx
}

for _, configMount := range config.VolumeMounts {
if idx, exists := existingMountMap[configMount.Name]; exists {
container.VolumeMounts[idx] = configMount
} else {
container.VolumeMounts = append(container.VolumeMounts, configMount)
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3085,6 +3085,205 @@ func Test_BundleCSVDeploymentGenerator_WithDeploymentConfig(t *testing.T) {
require.Equal(t, "existing_value", dep.Spec.Template.Spec.Containers[0].Env[0].Value)
},
},
{
name: "merges volumes from deployment config - overrides matching names",
bundle: &bundle.RegistryV1{
CSV: clusterserviceversion.Builder().
WithStrategyDeploymentSpecs(
v1alpha1.StrategyDeploymentSpec{
Name: "test-deployment",
Spec: appsv1.DeploymentSpec{
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{Name: "manager"},
},
Volumes: []corev1.Volume{
{
Name: "bundle-emptydir-vol",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
{
Name: "existing-vol",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
},
},
},
},
},
).Build(),
},
opts: render.Options{
InstallNamespace: "test-ns",
TargetNamespaces: []string{"test-ns"},
DeploymentConfig: &config.DeploymentConfig{
Volumes: []corev1.Volume{
{
Name: "bundle-emptydir-vol",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "test-cm-vol",
},
},
},
},
{
Name: "config-secret-vol",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "test-secret-vol",
},
},
},
},
},
},
verify: func(t *testing.T, objs []client.Object) {
require.Len(t, objs, 1)
dep := objs[0].(*appsv1.Deployment)
volumes := dep.Spec.Template.Spec.Volumes

// Should have 3 volumes total:
// - bundle-emptydir-vol (overridden to ConfigMap)
// - existing-vol (unchanged)
// - config-secret-vol (new)
require.Len(t, volumes, 3)

// Verify bundle-emptydir-vol was overridden (now ConfigMap, not EmptyDir)
var bundleVol *corev1.Volume
for i := range volumes {
if volumes[i].Name == "bundle-emptydir-vol" {
bundleVol = &volumes[i]
break
}
}
require.NotNil(t, bundleVol, "bundle-emptydir-vol should exist")
require.NotNil(t, bundleVol.ConfigMap, "bundle-emptydir-vol should be ConfigMap")
require.Equal(t, "test-cm-vol", bundleVol.ConfigMap.Name)
require.Nil(t, bundleVol.EmptyDir, "bundle-emptydir-vol should not be EmptyDir")

// Verify existing-vol remains unchanged
var existingVol *corev1.Volume
for i := range volumes {
if volumes[i].Name == "existing-vol" {
existingVol = &volumes[i]
break
}
}
require.NotNil(t, existingVol, "existing-vol should exist")
require.NotNil(t, existingVol.EmptyDir, "existing-vol should still be EmptyDir")

// Verify config-secret-vol was added
var secretVol *corev1.Volume
for i := range volumes {
if volumes[i].Name == "config-secret-vol" {
secretVol = &volumes[i]
break
}
}
require.NotNil(t, secretVol, "config-secret-vol should exist")
require.NotNil(t, secretVol.Secret, "config-secret-vol should be Secret")
require.Equal(t, "test-secret-vol", secretVol.Secret.SecretName)
},
},
{
name: "merges volumeMounts from deployment config - overrides matching names",
bundle: &bundle.RegistryV1{
CSV: clusterserviceversion.Builder().
WithStrategyDeploymentSpecs(
v1alpha1.StrategyDeploymentSpec{
Name: "test-deployment",
Spec: appsv1.DeploymentSpec{
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "manager",
VolumeMounts: []corev1.VolumeMount{
{
Name: "bundle-vol",
MountPath: "/old/path",
},
{
Name: "existing-vol",
MountPath: "/existing/path",
},
},
},
},
},
},
},
},
).Build(),
},
opts: render.Options{
InstallNamespace: "test-ns",
TargetNamespaces: []string{"test-ns"},
DeploymentConfig: &config.DeploymentConfig{
VolumeMounts: []corev1.VolumeMount{
{
Name: "bundle-vol",
MountPath: "/new/path",
},
{
Name: "config-vol",
MountPath: "/config/path",
},
},
},
},
verify: func(t *testing.T, objs []client.Object) {
require.Len(t, objs, 1)
dep := objs[0].(*appsv1.Deployment)
volumeMounts := dep.Spec.Template.Spec.Containers[0].VolumeMounts

// Should have 3 volume mounts total:
// - bundle-vol (overridden to /new/path)
// - existing-vol (unchanged)
// - config-vol (new)
require.Len(t, volumeMounts, 3)

// Verify bundle-vol was overridden
var bundleMount *corev1.VolumeMount
for i := range volumeMounts {
if volumeMounts[i].Name == "bundle-vol" {
bundleMount = &volumeMounts[i]
break
}
}
require.NotNil(t, bundleMount, "bundle-vol should exist")
require.Equal(t, "/new/path", bundleMount.MountPath, "bundle-vol mount path should be overridden")

// Verify existing-vol remains unchanged
var existingMount *corev1.VolumeMount
for i := range volumeMounts {
if volumeMounts[i].Name == "existing-vol" {
existingMount = &volumeMounts[i]
break
}
}
require.NotNil(t, existingMount, "existing-vol should exist")
require.Equal(t, "/existing/path", existingMount.MountPath)

// Verify config-vol was added
var configMount *corev1.VolumeMount
for i := range volumeMounts {
if volumeMounts[i].Name == "config-vol" {
configMount = &volumeMounts[i]
break
}
}
require.NotNil(t, configMount, "config-vol should exist")
require.Equal(t, "/config/path", configMount.MountPath)
},
},
} {
t.Run(tc.name, func(t *testing.T) {
objs, err := generators.BundleCSVDeploymentGenerator(tc.bundle, tc.opts)
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,8 @@ golang.org/x/crypto/scrypt
## explicit; go 1.24.0
golang.org/x/exp/maps
golang.org/x/exp/slices
# golang.org/x/mod v0.33.0
## explicit; go 1.24.0
# golang.org/x/mod v0.34.0
## explicit; go 1.25.0
golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/modfile
golang.org/x/mod/module
Expand Down