Merge pull request #1043 from michael-voegeli-fnt/master

feat(helm): support both object and string formats for imagePullSecrets
This commit is contained in:
Muhammad Safwan Karim
2025-12-11 00:16:35 +05:00
committed by GitHub
4 changed files with 22 additions and 3 deletions

View File

@@ -87,3 +87,19 @@ Create the namespace selector if it does not watch globally
{{ .Values.reloader.namespaceSelector }}
{{- end -}}
{{- end -}}
{{/*
Normalizes global.imagePullSecrets to a list of objects with name fields.
Supports both of these in values.yaml:
# - name: my-pull-secret
# - my-pull-secret
*/}}
{{- define "reloader-imagePullSecrets" -}}
{{- range $s := .Values.global.imagePullSecrets }}
{{- if kindIs "map" $s }}
- {{ toYaml $s | nindent 2 | trim }}
{{- else }}
- name: {{ $s }}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -44,9 +44,9 @@ spec:
{{ tpl (toYaml .Values.reloader.matchLabels) . | indent 8 }}
{{- end }}
spec:
{{- with .Values.global.imagePullSecrets }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{ include "reloader-imagePullSecrets" . | indent 8 }}
{{- end }}
{{- if .Values.reloader.deployment.nodeSelector }}
nodeSelector:

View File

@@ -2,7 +2,8 @@
apiVersion: v1
kind: ServiceAccount
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 2 }}
imagePullSecrets:
{{ include "reloader-imagePullSecrets" . | indent 2 }}
{{- end }}
{{- if hasKey .Values.reloader.serviceAccount "automountServiceAccountToken" }}
automountServiceAccountToken: {{ .Values.reloader.serviceAccount.automountServiceAccountToken }}

View File

@@ -7,6 +7,8 @@ global:
imagePullSecrets: []
#imagePullSecrets:
# - name: my-pull-secret
#imagePullSecrets:
# - my-pull-secret
kubernetes:
host: https://kubernetes.default