Add ImagePullSecrets to CSI daemonset (#519)

This commit is contained in:
mehmetsalgar 2021-05-12 13:06:54 +02:00 committed by GitHub
parent 6e8ef40840
commit 92aed2cbee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

View file

@ -73,4 +73,8 @@ spec:
{{- if .Values.csi.volumes }}
{{- toYaml .Values.csi.volumes | nindent 8}}
{{- end }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
{{- end }}
{{- end }}

View file

@ -62,6 +62,35 @@ load _helpers
[ "${actual}" = "SomePullPolicy" ]
}
@test "csi/daemonset: Custom imagePullSecrets" {
cd `chart_dir`
local object=$(helm template \
--show-only templates/csi-daemonset.yaml \
--set "csi.enabled=true" \
--set 'global.imagePullSecrets[0].name=foo' \
--set 'global.imagePullSecrets[1].name=bar' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.imagePullSecrets' | tee /dev/stderr)
local actual=$(echo $object |
yq -r '.[0].name' | tee /dev/stderr)
[ "${actual}" = "foo" ]
local actual=$(echo $object |
yq -r '.[1].name' | tee /dev/stderr)
[ "${actual}" = "bar" ]
}
@test "csi/daemonset: default imagePullSecrets" {
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.imagePullSecrets' | tee /dev/stderr)
[ "${actual}" = "null" ]
}
# Debug arg
@test "csi/daemonset: debug arg is configurable" {
cd `chart_dir`