Skip to content

Commit

Permalink
fix(common): correct mistakes in install and upgrade init containers
Browse files Browse the repository at this point in the history
  • Loading branch information
kjeld Schouten-Lebbing committed Jan 23, 2022
1 parent b48cea1 commit 0496669
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/library/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 8.14.0
version: 8.14.1
32 changes: 16 additions & 16 deletions charts/library/common/templates/lib/controller/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,33 @@ terminationGracePeriodSeconds: {{ . }}
initContainers:
{{- include "common.controller.autopermissions" . | nindent 2 }}
{{- include "common.dependencies.postgresql.init" . | nindent 2 }}
{{- if .Values.initContainers }}
{{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.initContainers $key }}
{{- if .Release.IsInstall }}
{{- if .Values.installContainers }}
{{- $installContainers := list }}
{{- range $index, $key := (keys .Values.installContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.installContainers $key }}
{{- if not $container.name -}}
{{- $_ := set $container "name" $key }}
{{- end }}
{{- $initContainers = append $initContainers $container }}
{{- $installContainers = append $installContainers $container }}
{{- end }}
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
{{- tpl (toYaml $installContainers) $ | nindent 2 }}
{{- end }}
{{- if .Release.IsInstall }}
{{- if .Values.installContainers }}
{{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.initContainers $key }}
{{- end }}
{{- if .Release.IsUpgrade }}
{{- if .Values.upgradeContainers }}
{{- $upgradeContainers := list }}
{{- range $index, $key := (keys .Values.upgradeContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.upgradeContainers $key }}
{{- if not $container.name -}}
{{- $_ := set $container "name" $key }}
{{- end }}
{{- $initContainers = append $initContainers $container }}
{{- $upgradeContainers = append $upgradeContainers $container }}
{{- end }}
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
{{- tpl (toYaml $upgradeContainers) $ | nindent 2 }}
{{- end }}
{{- end }}
{{- if .Release.IsUpgrade }}
{{- if .Values.upgradeContainers }}
{{- if .Values.initContainers }}
{{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.initContainers $key }}
Expand All @@ -88,7 +89,6 @@ initContainers:
{{- end }}
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
{{- end }}
{{- end }}
containers:
{{- include "common.controller.mainContainer" . | nindent 2 }}
{{- with .Values.additionalContainers }}
Expand Down

0 comments on commit 0496669

Please sign in to comment.