Skip to content

Commit 3c00b57

Browse files
committed
✨ feat: add luksOpen additional args
1 parent 17ea396 commit 3c00b57

29 files changed

+596
-517
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ test-e2e-single-az-buildx:
106106
bin/mockgen:
107107
go install github.com/golang/mock/mockgen@latest
108108

109-
mockgen:
109+
.PHONY: mock-generate
110+
mock-generate:
110111
./hack/update-gomock
111112

112113
.PHONY: trivy-scan

cmd/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func main() {
3232
driver.WithEndpoint(options.ServerOptions.Endpoint),
3333
driver.WithExtraVolumeTags(options.ControllerOptions.ExtraVolumeTags),
3434
driver.WithExtraSnapshotTags(options.ControllerOptions.ExtraSnapshotTags),
35+
driver.WithLuksOpenFlags(options.NodeOptions.LuksOpenFlags),
3536
driver.WithMode(options.DriverMode),
3637
)
3738
if err != nil {

cmd/options/node_options.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,17 @@ package options
1818

1919
import (
2020
"flag"
21+
22+
cliflag "k8s.io/component-base/cli/flag"
2123
)
2224

2325
// NodeOptions contains options and configuration settings for the node service.
24-
type NodeOptions struct{}
26+
type NodeOptions struct {
27+
// LuksOpenFlags is a list of flags to add to cryptsetup luksOpen.
28+
// It is a comma separated list of strings '--perf-no_read_workqueue,--perf-no_write_workqueue'.
29+
LuksOpenFlags []string
30+
}
2531

26-
func (s *NodeOptions) AddFlags(fs *flag.FlagSet) {}
32+
func (s *NodeOptions) AddFlags(fs *flag.FlagSet) {
33+
fs.Var(cliflag.NewStringSlice(&s.LuksOpenFlags), "luks-open-flags", "Flag to add to cryptsetup luksOpen. It may be specified multiple times to add multiple flags, for example: '--luks-open-flags=--perf-no_read_workqueue --luks-open-flags=--perf-no_write_workqueue'")
34+
}

cmd/options/node_options_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ func TestNodeOptions(t *testing.T) {
2727
flag string
2828
found bool
2929
}{
30+
{
31+
name: "lookup desired flag",
32+
flag: "luks-open-flags",
33+
found: true,
34+
},
3035
{
3136
name: "fail for non-desired flag",
3237
flag: "some-flag",

cmd/options_test.go

Lines changed: 43 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"testing"
2323

2424
"github.com/outscale/osc-bsu-csi-driver/pkg/driver"
25+
"github.com/stretchr/testify/assert"
2526
"github.com/stretchr/testify/require"
2627
)
2728

@@ -89,78 +90,47 @@ func TestGetOptions(t *testing.T) {
8990
return options
9091
}
9192

92-
testCases := []struct {
93-
name string
94-
testFunc func(t *testing.T)
95-
}{
96-
{
97-
name: "no controller mode given - expect all mode",
98-
testFunc: func(t *testing.T) {
99-
options := testFunc(t, nil, true, true, true)
100-
101-
if options.DriverMode != driver.AllMode {
102-
t.Fatalf("expected driver mode to be %q but it is %q", driver.AllMode, options.DriverMode)
103-
}
104-
},
105-
},
106-
{
107-
name: "all mode given - expect all mode",
108-
testFunc: func(t *testing.T) {
109-
options := testFunc(t, []string{"all"}, true, true, true)
110-
111-
if options.DriverMode != driver.AllMode {
112-
t.Fatalf("expected driver mode to be %q but it is %q", driver.AllMode, options.DriverMode)
113-
}
114-
},
115-
},
116-
{
117-
name: "controller mode given - expect controller mode",
118-
testFunc: func(t *testing.T) {
119-
options := testFunc(t, []string{"controller"}, true, true, false)
120-
121-
if options.DriverMode != driver.ControllerMode {
122-
t.Fatalf("expected driver mode to be %q but it is %q", driver.ControllerMode, options.DriverMode)
123-
}
124-
},
125-
},
126-
{
127-
name: "node mode given - expect node mode",
128-
testFunc: func(t *testing.T) {
129-
options := testFunc(t, []string{"node"}, true, false, true)
130-
131-
if options.DriverMode != driver.NodeMode {
132-
t.Fatalf("expected driver mode to be %q but it is %q", driver.NodeMode, options.DriverMode)
133-
}
134-
},
135-
},
136-
{
137-
name: "version flag specified",
138-
testFunc: func(t *testing.T) {
139-
oldOSExit := osExit
140-
defer func() { osExit = oldOSExit }()
141-
142-
var exitCode int
143-
testExit := func(code int) {
144-
exitCode = code
145-
}
146-
osExit = testExit
147-
148-
oldArgs := os.Args
149-
defer func() { os.Args = oldArgs }()
150-
os.Args = []string{
151-
"osc-bsu-csi-driver",
152-
"-version",
153-
}
154-
155-
flagSet := flag.NewFlagSet("test-flagset", flag.ContinueOnError)
156-
_ = GetOptions(flagSet)
157-
158-
require.Zero(t, exitCode)
159-
},
160-
},
161-
}
93+
t.Run("no controller mode given - expect all mode", func(t *testing.T) {
94+
options := testFunc(t, nil, true, true, true)
95+
assert.Equal(t, driver.AllMode, options.DriverMode)
96+
})
97+
t.Run("all mode given - expect all mode", func(t *testing.T) {
98+
options := testFunc(t, []string{"all"}, true, true, true)
99+
assert.Equal(t, driver.AllMode, options.DriverMode)
100+
101+
})
102+
t.Run("controller mode given - expect controller mode", func(t *testing.T) {
103+
options := testFunc(t, []string{"controller"}, true, true, false)
104+
assert.Equal(t, driver.ControllerMode, options.DriverMode)
105+
})
106+
t.Run("node mode given - expect node mode", func(t *testing.T) {
107+
options := testFunc(t, []string{"node"}, true, false, true)
108+
assert.Equal(t, driver.NodeMode, options.DriverMode)
109+
})
110+
t.Run("luks open flags", func(t *testing.T) {
111+
options := testFunc(t, []string{"node", "--luks-open-flags=--perf-no_read_workqueue", "--luks-open-flags=--perf-no_write_workqueue"}, true, false, true)
112+
assert.Equal(t, []string{"--perf-no_read_workqueue", "--perf-no_write_workqueue"}, options.NodeOptions.LuksOpenFlags)
113+
})
114+
t.Run("version flag specified", func(t *testing.T) {
115+
oldOSExit := osExit
116+
defer func() { osExit = oldOSExit }()
117+
118+
var exitCode int
119+
testExit := func(code int) {
120+
exitCode = code
121+
}
122+
osExit = testExit
162123

163-
for _, tc := range testCases {
164-
t.Run(tc.name, tc.testFunc)
165-
}
124+
oldArgs := os.Args
125+
defer func() { os.Args = oldArgs }()
126+
os.Args = []string{
127+
"osc-bsu-csi-driver",
128+
"-version",
129+
}
130+
131+
flagSet := flag.NewFlagSet("test-flagset", flag.ContinueOnError)
132+
_ = GetOptions(flagSet)
133+
134+
require.Zero(t, exitCode)
135+
})
166136
}

docs/helm.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ Kubernetes: `>=1.20`
5151
| maxBsuVolumes | string | `"39"` | Maximum volume to attach to a node (see [Docs](https://docs.outscale.com/en/userguide/About-Volumes.html)) |
5252
| nameOverride | string | `""` | Override name of the app (instead of `osc-bsu-csi-driver`) |
5353
| noProxy | string | `""` | Value used to create environment variable NO_PROXY |
54+
| node.args | list | `[]` | Node controller command line additional args |
5455
| node.containerSecurityContext.allowPrivilegeEscalation | bool | `true` | |
5556
| node.containerSecurityContext.privileged | bool | `true` | |
5657
| node.containerSecurityContext.readOnlyRootFilesystem | bool | `false` | |
5758
| node.containerSecurityContext.seccompProfile.type | string | `"Unconfined"` | |
58-
| node.podAnnotations | object | `{}` | Annotations for controller pod |
59-
| node.podLabels | object | `{}` | Labels for controller pod |
59+
| node.podAnnotations | object | `{}` | Annotations for node controller pod |
60+
| node.podLabels | object | `{}` | Labels for node controller pod |
6061
| node.resources | object | `{}` | Node controller (DaemonSet) resources. If not set, the top-level resources will be used. |
6162
| node.tolerations | list | `[]` | Pod tolerations |
6263
| nodeSelector | object | `{}` | |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ replace (
1212
require (
1313
github.com/aws/aws-sdk-go v1.55.7
1414
github.com/container-storage-interface/spec v1.8.0
15-
github.com/golang/mock v1.6.0
1615
github.com/kubernetes-csi/csi-test/v5 v5.1.0
1716
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0
1817
github.com/onsi/ginkgo/v2 v2.20.1
1918
github.com/onsi/gomega v1.34.1
2019
github.com/outscale/osc-sdk-go/v2 v2.26.0
2120
github.com/rs/xid v1.6.0
2221
github.com/stretchr/testify v1.10.0
22+
go.uber.org/mock v0.5.1
2323
golang.org/x/sys v0.31.0
2424
google.golang.org/grpc v1.71.1
2525
google.golang.org/protobuf v1.36.4

go.sum

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW
7474
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
7575
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
7676
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
77-
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
78-
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
7977
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
8078
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
8179
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
@@ -201,7 +199,6 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5
201199
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
202200
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
203201
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
204-
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
205202
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
206203
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
207204
go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k=
@@ -242,6 +239,8 @@ go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeX
242239
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
243240
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
244241
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
242+
go.uber.org/mock v0.5.1 h1:ASgazW/qBmR+A32MYFDB6E2POoTgOwT509VP0CT/fjs=
243+
go.uber.org/mock v0.5.1/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
245244
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
246245
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
247246
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
@@ -255,34 +254,27 @@ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0
255254
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
256255
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
257256
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
258-
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
259257
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
260258
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
261259
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
262260
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
263261
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
264262
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
265-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
266263
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
267264
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
268265
golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
269266
golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
270267
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
271268
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
272269
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
273-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
274270
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
275271
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
276272
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
277273
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
278274
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
279-
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
280-
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
281-
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
282275
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
283276
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
284277
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
285-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
286278
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
287279
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
288280
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -295,7 +287,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
295287
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
296288
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
297289
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
298-
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
299290
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
300291
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
301292
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

hack/update-gomock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ IMPORT_PATH=github.com/outscale/osc-bsu-csi-driver
2020

2121
# mockgen -package=mocks -destination=./pkg/cloud/mocks/mock_ec2.go ${IMPORT_PATH}/pkg/cloud EC2
2222
mockgen -package=mocks -destination=./pkg/cloud/mocks/mock_ec2metadata.go ${IMPORT_PATH}/pkg/cloud EC2Metadata
23+
mockgen -package=mocks -destination=./pkg/cloud/mocks/mock_osc.go ${IMPORT_PATH}/pkg/cloud OscInterface
2324

2425
mockgen -package=mocks -destination=./pkg/driver/mocks/mock_cloud.go ${IMPORT_PATH}/pkg/cloud Cloud
2526
mockgen -package=mocks -destination=./pkg/driver/mocks/mock_metadata_service.go ${IMPORT_PATH}/pkg/cloud MetadataService
2627
mockgen -package=mocks -destination=./pkg/driver/mocks/mock_mounter.go ${IMPORT_PATH}/pkg/driver Mounter
27-
28+
mockgen -package=mocks -destination=./pkg/driver/mocks/mock_cmd.go k8s.io/utils/exec Interface,Cmd

osc-bsu-csi-driver/helm_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func TestHelmTemplate_Deployment(t *testing.T) {
132132
Limits: nil,
133133
}, manager.Resources)
134134
})
135+
135136
t.Run("Resources can be set globally", func(t *testing.T) {
136137
dep := getDeployment(t,
137138
"enableVolumeResizing=true", "enableVolumeSnapshot=true",
@@ -256,6 +257,7 @@ func TestHelmTemplate_DaemonSet(t *testing.T) {
256257
Limits: nil,
257258
}, manager.Resources)
258259
})
260+
259261
t.Run("Resources can be set globally", func(t *testing.T) {
260262
dep := getDaemonSet(t,
261263
"enableVolumeResizing=true", "enableVolumeSnapshot=true",
@@ -300,4 +302,15 @@ func TestHelmTemplate_DaemonSet(t *testing.T) {
300302
}, container.Resources, container.Name)
301303
}
302304
})
305+
306+
t.Run("Additional args can be set", func(t *testing.T) {
307+
dep := getDaemonSet(t,
308+
"node.args={--luks-open-flags=--perf-no_read_workqueue,--luks-open-flags=--perf-no_write_workqueue}",
309+
)
310+
require.Len(t, dep.Spec.Template.Spec.Containers, 3)
311+
assert.Equal(t, []string{
312+
"node", "--endpoint=$(CSI_ENDPOINT)", "--logtostderr", "--v=3", "--luks-open-flags=--perf-no_read_workqueue", "--luks-open-flags=--perf-no_write_workqueue"},
313+
dep.Spec.Template.Spec.Containers[0].Args)
314+
})
315+
303316
}

0 commit comments

Comments
 (0)