Add extraArgs value for CSI (#526)
This commit is contained in:
parent
dbd99b10c0
commit
030d3cd89d
4 changed files with 39 additions and 0 deletions
|
@ -37,6 +37,9 @@ spec:
|
||||||
args:
|
args:
|
||||||
- --endpoint=/provider/vault.sock
|
- --endpoint=/provider/vault.sock
|
||||||
- --debug={{ .Values.csi.debug }}
|
- --debug={{ .Values.csi.debug }}
|
||||||
|
{{- if .Values.csi.extraArgs }}
|
||||||
|
{{- toYaml .Values.csi.extraArgs | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: providervol
|
- name: providervol
|
||||||
mountPath: "/provider"
|
mountPath: "/provider"
|
||||||
|
|
|
@ -110,6 +110,36 @@ load _helpers
|
||||||
[ "${actual}" = "--debug=true" ]
|
[ "${actual}" = "--debug=true" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Extra args
|
||||||
|
@test "csi/daemonset: extra args can be passed" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/csi-daemonset.yaml \
|
||||||
|
--set "csi.enabled=true" \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.containers[0].args | length' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "2" ]
|
||||||
|
|
||||||
|
local object=$(helm template \
|
||||||
|
--show-only templates/csi-daemonset.yaml \
|
||||||
|
--set "csi.enabled=true" \
|
||||||
|
--set "csi.extraArgs={--foo=bar,--bar baz,first}" \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.containers[0]')
|
||||||
|
local actual=$(echo $object |
|
||||||
|
yq -r '.args | length' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "5" ]
|
||||||
|
local actual=$(echo $object |
|
||||||
|
yq -r '.args[2]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "--foo=bar" ]
|
||||||
|
local actual=$(echo $object |
|
||||||
|
yq -r '.args[3]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "--bar baz" ]
|
||||||
|
local actual=$(echo $object |
|
||||||
|
yq -r '.args[4]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "first" ]
|
||||||
|
}
|
||||||
|
|
||||||
# updateStrategy
|
# updateStrategy
|
||||||
@test "csi/daemonset: updateStrategy is configurable" {
|
@test "csi/daemonset: updateStrategy is configurable" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"extraArgs": {
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
"image": {
|
"image": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -773,3 +773,6 @@ csi:
|
||||||
|
|
||||||
# Enables debug logging.
|
# Enables debug logging.
|
||||||
debug: false
|
debug: false
|
||||||
|
|
||||||
|
# Pass arbitrary additional arguments to vault-csi-provider.
|
||||||
|
extraArgs: []
|
||||||
|
|
Loading…
Reference in a new issue