Skip to content

Commit afdc5c1

Browse files
authored
PowerMax Mount Credentials: Override Minimal Manifest Images (#929)
1 parent 9c06098 commit afdc5c1

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

pkg/drivers/commonconfig.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,17 @@ func GetNode(ctx context.Context, cr csmv1.ContainerStorageModule, operatorConfi
277277
for i, c := range containers {
278278
if c.Name != nil && string(*c.Name) == "driver" {
279279
// Check if Common is not nil before accessing its fields
280-
if cr.Spec.Driver.Common != nil && cr.Spec.Driver.Node != nil {
281-
containers[i].Env = utils.ReplaceAllApplyCustomEnvs(c.Env, cr.Spec.Driver.Common.Envs, cr.Spec.Driver.Node.Envs)
282-
c.Env = containers[i].Env
283-
if string(cr.Spec.Driver.Common.Image) != "" {
280+
if cr.Spec.Driver.Common != nil {
281+
// With minimal, this will override the node image if the driver image is overridden.
282+
if cr.Spec.Driver.Common.Image != "" {
284283
image := string(cr.Spec.Driver.Common.Image)
285284
c.Image = &image
286285
}
286+
287+
if cr.Spec.Driver.Node != nil {
288+
containers[i].Env = utils.ReplaceAllApplyCustomEnvs(c.Env, cr.Spec.Driver.Common.Envs, cr.Spec.Driver.Node.Envs)
289+
c.Env = containers[i].Env
290+
}
287291
}
288292
}
289293
removeContainer := false

tests/e2e/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24
44

55
require (
66
github.com/dell/csm-operator v0.0.0
7-
github.com/onsi/ginkgo/v2 v2.22.2
7+
github.com/onsi/ginkgo/v2 v2.23.3
88
github.com/onsi/gomega v1.36.2
99
golang.org/x/mod v0.24.0
1010
k8s.io/api v0.32.0
@@ -118,7 +118,7 @@ require (
118118
golang.org/x/term v0.29.0 // indirect
119119
golang.org/x/text v0.22.0 // indirect
120120
golang.org/x/time v0.8.0 // indirect
121-
golang.org/x/tools v0.28.0 // indirect
121+
golang.org/x/tools v0.30.0 // indirect
122122
google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb // indirect
123123
google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect
124124
google.golang.org/grpc v1.69.2 // indirect

tests/e2e/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
158158
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
159159
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
160160
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
161-
github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU=
162-
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
161+
github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0=
162+
github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
163163
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
164164
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
165165
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -306,8 +306,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
306306
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
307307
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
308308
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
309-
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
310-
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
309+
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
310+
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
311311
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
312312
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
313313
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

tests/e2e/steps/steps_def.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,18 +360,13 @@ func (step *Step) validateMinimalCSMDriverSpec(res Resource, driverName string,
360360
len(driver.InitContainers) > 0 ||
361361
len(driver.SnapshotClass) > 0 ||
362362
driver.Controller != nil ||
363-
driver.Node != nil ||
364363
driver.CSIDriverSpec != nil ||
365364
driver.DNSPolicy != "" ||
366365
driver.AuthSecret != "" ||
367366
driver.TLSCertSecret != "" {
368367
return fmt.Errorf("unexpected fields found in Driver spec: %+v", driver)
369368
}
370369

371-
if driver.CSIDriverType == csmv1.PowerMax && found.HasModule(csmv1.ReverseProxy) {
372-
return fmt.Errorf("csm resource '%s' contains reverse proxy module", cr.Name)
373-
}
374-
375370
return nil
376371
}
377372

tests/e2e/testfiles/minimal-testfiles/storage_csm_powermax_secret.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ spec:
99
configVersion: v2.14.0
1010
forceRemoveDriver: true
1111
common:
12+
image: quay.io/dell/container-storage-modules/csi-powermax:nightly
1213
envs:
1314
- name: "X_CSI_REVPROXY_USE_SECRET"
1415
value: "true"
1516
modules:
17+
- name: csireverseproxy
18+
components:
19+
- name: csipowermax-reverseproxy
20+
image: quay.io/dell/container-storage-modules/csipowermax-reverseproxy:nightly
1621
- name: authorization
1722
enabled: false
1823
- name: resiliency
@@ -21,3 +26,10 @@ spec:
2126
enabled: false
2227
- name: observability
2328
enabled: false
29+
components:
30+
- name: metrics-powermax
31+
enabled: true
32+
image: quay.io/dell/container-storage-modules/csm-metrics-powermax:nightly
33+
- name: topology
34+
enabled: true
35+
image: quay.io/dell/container-storage-modules/csm-topology:nightly

0 commit comments

Comments
 (0)