diff --git a/deployment/network-operator/templates/_helpers.tpl b/deployment/network-operator/templates/_helpers.tpl index 198e47ad3..221c93221 100644 --- a/deployment/network-operator/templates/_helpers.tpl +++ b/deployment/network-operator/templates/_helpers.tpl @@ -67,20 +67,24 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* -imagePullSecrets helpers +imagePullSecrets helper - supports global.imagePullSecrets, operator.imagePullSecrets and root imagePullSecrets fallback */}} -{{- define "network-operator.operator.imagePullSecrets" }} -{{- $imagePullSecrets := list }} -{{- if .Values.operator.imagePullSecrets }} -{{- range .Values.operator.imagePullSecrets }} -{{- $imagePullSecrets = append $imagePullSecrets (dict "name" . ) }} -{{- end }} -{{- else }} -{{- if .Values.imagePullSecrets }} -{{- range .Values.imagePullSecrets }} -{{- $imagePullSecrets = append $imagePullSecrets (dict "name" . ) }} -{{- end }} -{{- end }} -{{- end }} +{{- define "network-operator.operator.imagePullSecrets" -}} +{{- $imagePullSecrets := list -}} +{{- if .Values.operator.imagePullSecrets -}} + {{- range .Values.operator.imagePullSecrets -}} + {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) -}} + {{- end -}} +{{- else if .Values.imagePullSecrets -}} + {{- range .Values.imagePullSecrets -}} + {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) -}} + {{- end -}} +{{- else if .Values.global.imagePullSecrets -}} + {{- range .Values.global.imagePullSecrets -}} + {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) -}} + {{- end -}} +{{- end -}} +{{- if $imagePullSecrets -}} {{- $imagePullSecrets | toJson }} -{{- end }} \ No newline at end of file +{{- end -}} +{{- end -}} diff --git a/deployment/network-operator/values.yaml b/deployment/network-operator/values.yaml index 907324324..f1f1a8bd8 100644 --- a/deployment/network-operator/values.yaml +++ b/deployment/network-operator/values.yaml @@ -320,8 +320,13 @@ operator: # -- An optional list of references to secrets to use for pulling any of the # Network Operator images. +# Kept for backward compatibility. imagePullSecrets: [] +# -- Global values to be propagated into Network-Operator sub-charts +global: + imagePullSecrets: [] + # @ignore test: pf: ens2f0 diff --git a/hack/templates/values/values.template b/hack/templates/values/values.template index 3cb112e0f..986f90192 100644 --- a/hack/templates/values/values.template +++ b/hack/templates/values/values.template @@ -320,8 +320,13 @@ operator: # -- An optional list of references to secrets to use for pulling any of the # Network Operator images. +# Kept for backward compatibility. imagePullSecrets: [] +# -- Global values to be propagated into Network-Operator sub-charts +global: + imagePullSecrets: [] + # @ignore test: pf: ens2f0