Skip to content

Commit

Permalink
fix: Allow multiple imagePullSecrets to work
Browse files Browse the repository at this point in the history
This fixes an issue where the extra indentation causes invalid yaml if 2+ imagePullSecrets are specified.

Also don't set them at all if not asked for - this fixes an issue for us where it conflicts with a kyverno ClusterPolicy that defaults our imagePullSecrets for everything, and the explicit setting of [] was causing a persistent diff in ArgoCD
  • Loading branch information
mikebryant committed Aug 7, 2024
1 parent 7f2885f commit da3b367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ metadata:
{{- with .Values.serviceAccount.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{ with .Values.imagePullSecrets }}
imagePullSecrets: {{ toYaml . | nindent 2 }}
{{- end -}}
{{- end }}
5 changes: 3 additions & 2 deletions charts/k8s-image-swapper/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{ with .Values.imagePullSecrets }}
imagePullSecrets: {{ toYaml . | nindent 2 }}
{{- end -}}
{{- end }}

0 comments on commit da3b367

Please sign in to comment.