Add ImagePullSecrets to CSI daemonset (#519)
This commit is contained in:
parent
6e8ef40840
commit
92aed2cbee
2 changed files with 33 additions and 0 deletions
|
@ -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 }}
|
||||
|
|
|
@ -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`
|
||||
|
|
Loading…
Reference in a new issue