Skip to content

Commit

Permalink
feat: allow specifying init container tag in Stack helm chart (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
hspitzley-czi authored Jun 20, 2024
1 parent a7dd83d commit 265194e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,12 @@ env:
{{- else }}
env: []
{{- end }}
{{- end }}

{{- define "initContainer.image" -}}
{{- if typeIs "string" .Values.image }}
image: {{ .Values.image }}
{{ else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions stack/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
{{- end }}
initContainers:
{{- range $i, $container := .Values.initContainers }}
{{- $imageDict := fromYaml (include "initContainer.image" (dict "Chart" $global.Chart "Values" $container)) }}
{{- $container = mergeOverwrite $container $imageDict }}
{{- with omit $container "envFrom" }}
- {{- toYaml . | nindent 10 }}
{{- include "service.configuration" $service | nindent 10}}
Expand Down

0 comments on commit 265194e

Please sign in to comment.