Skip to content

Commit 4f50e4c

Browse files
committed
chore: Adding '.Values.global.imagePullSecrets' to be propagated into network-operator sub-charts
Signed-off-by: Ido Heyvi <[email protected]>
1 parent b4370ed commit 4f50e4c

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

deployment/network-operator/templates/_helpers.tpl

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,24 @@ app.kubernetes.io/instance: {{ .Release.Name }}
6767
{{- end }}
6868

6969
{{/*
70-
imagePullSecrets helpers
70+
imagePullSecrets helper - supports global.imagePullSecrets, operator.imagePullSecrets and root imagePullSecrets fallback
7171
*/}}
72-
{{- define "network-operator.operator.imagePullSecrets" }}
73-
{{- $imagePullSecrets := list }}
74-
{{- if .Values.operator.imagePullSecrets }}
75-
{{- range .Values.operator.imagePullSecrets }}
76-
{{- $imagePullSecrets = append $imagePullSecrets (dict "name" . ) }}
77-
{{- end }}
78-
{{- else }}
79-
{{- if .Values.imagePullSecrets }}
80-
{{- range .Values.imagePullSecrets }}
81-
{{- $imagePullSecrets = append $imagePullSecrets (dict "name" . ) }}
82-
{{- end }}
83-
{{- end }}
84-
{{- end }}
72+
{{- define "network-operator.operator.imagePullSecrets" -}}
73+
{{- $imagePullSecrets := list -}}
74+
{{- if .Values.operator.imagePullSecrets -}}
75+
{{- range .Values.operator.imagePullSecrets -}}
76+
{{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) -}}
77+
{{- end -}}
78+
{{- else if .Values.imagePullSecrets -}}
79+
{{- range .Values.imagePullSecrets -}}
80+
{{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) -}}
81+
{{- end -}}
82+
{{- else if .Values.global.imagePullSecrets -}}
83+
{{- range .Values.global.imagePullSecrets -}}
84+
{{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) -}}
85+
{{- end -}}
86+
{{- end -}}
87+
{{- if $imagePullSecrets -}}
8588
{{- $imagePullSecrets | toJson }}
86-
{{- end }}
89+
{{- end -}}
90+
{{- end -}}

deployment/network-operator/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,13 @@ operator:
320320

321321
# -- An optional list of references to secrets to use for pulling any of the
322322
# Network Operator images.
323+
# Kept for backward compatibility.
323324
imagePullSecrets: []
324325

326+
# -- Global values to be propagated into Network-Operator sub-charts
327+
global:
328+
imagePullSecrets: []
329+
325330
# @ignore
326331
test:
327332
pf: ens2f0

0 commit comments

Comments
 (0)