Skip to content

Commit 7e0d01f

Browse files
authored
MAJOR: kubernetes-ingress: Make initContainers templateable (#311)
1 parent be288fe commit 7e0d01f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

kubernetes-ingress/templates/controller-daemonset.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,13 @@ spec:
276276
{{- else if gt (len .Values.controller.extraVolumes) 0 }}
277277
{{ toYaml .Values.controller.extraVolumes | indent 8 }}
278278
{{- end }}
279-
{{- with.Values.controller.initContainers }}
279+
{{- if .Values.controller.initContainers }}
280280
initContainers:
281-
{{- toYaml . | nindent 8 }}
281+
{{- if eq "string" (printf "%T" .Values.controller.initContainers) }}
282+
{{ tpl .Values.controller.initContainers . | indent 8 }}
283+
{{- else }}
284+
{{ toYaml .Values.controller.initContainers | indent 8 }}
285+
{{- end }}
282286
{{- end }}
283287
{{- with .Values.controller.nodeSelector }}
284288
nodeSelector:

kubernetes-ingress/templates/controller-deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,13 @@ spec:
269269
{{- else if gt (len .Values.controller.extraVolumes) 0 }}
270270
{{ toYaml .Values.controller.extraVolumes | indent 8 }}
271271
{{- end }}
272-
{{- with.Values.controller.initContainers }}
272+
{{- if .Values.controller.initContainers }}
273273
initContainers:
274-
{{- toYaml . | nindent 8 }}
274+
{{- if eq "string" (printf "%T" .Values.controller.initContainers) }}
275+
{{ tpl .Values.controller.initContainers . | indent 8 }}
276+
{{- else }}
277+
{{ toYaml .Values.controller.initContainers | indent 8 }}
278+
{{- end }}
275279
{{- end }}
276280
{{- with .Values.controller.nodeSelector }}
277281
nodeSelector:

kubernetes-ingress/templates/controller-proxy-deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,13 @@ spec:
260260
{{- else if gt (len .Values.controller.extraVolumes) 0 }}
261261
{{ toYaml .Values.controller.extraVolumes | indent 8 }}
262262
{{- end }}
263-
{{- with.Values.controller.initContainers }}
263+
{{- if .Values.controller.initContainers }}
264264
initContainers:
265-
{{- toYaml . | nindent 8 }}
265+
{{- if eq "string" (printf "%T" .Values.controller.initContainers) }}
266+
{{ tpl .Values.controller.initContainers . | indent 8 }}
267+
{{- else }}
268+
{{ toYaml .Values.controller.initContainers | indent 8 }}
269+
{{- end }}
266270
{{- end }}
267271
{{- with .Values.controller.nodeSelector }}
268272
nodeSelector:

0 commit comments

Comments
 (0)