Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts: Fix imagePullSecrets #1560

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions charts/secrets-store-csi-driver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,20 @@ Return the appropriate apiVersion for CSIDriver.
{{- print "storage.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}

{{/*
imagePullSecrets generates pull secrets from either string or map values.
A map value must be indexable by the key 'name'.
*/}}
{{- define "imagePullSecrets" -}}
{{- with .Values.imagePullSecrets -}}
imagePullSecrets:
{{- range . -}}
{{- if typeIs "string" . }}
- name: {{ . }}
{{- else if index . "name" }}
- name: {{ .name }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ template "sscd.fullname" . }}-upgrade-crds
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 6 }}
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
restartPolicy: Never
containers:
- name: crds-upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ template "sscd.fullname" . }}-keep-crds
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 6 }}
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
restartPolicy: Never
containers:
- name: crds-keep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ spec:
{{- end }}
spec:
serviceAccountName: secrets-store-csi-driver
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
affinity:
{{ toYaml .Values.windows.affinity | indent 8 }}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ spec:
{{- end }}
spec:
serviceAccountName: secrets-store-csi-driver
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
affinity:
{{ toYaml .Values.linux.affinity | indent 8 }}
containers:
Expand Down