diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index eeef0dd769b..5deb726d579 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 8.14.0 +version: 8.14.1 diff --git a/charts/library/common/templates/lib/controller/_pod.tpl b/charts/library/common/templates/lib/controller/_pod.tpl index 78e93f4548c..af3971f2fd0 100644 --- a/charts/library/common/templates/lib/controller/_pod.tpl +++ b/charts/library/common/templates/lib/controller/_pod.tpl @@ -52,6 +52,32 @@ terminationGracePeriodSeconds: {{ . }} initContainers: {{- include "common.controller.autopermissions" . | nindent 2 }} {{- include "common.dependencies.postgresql.init" . | nindent 2 }} + {{- 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 }} + {{- $installContainers = append $installContainers $container }} + {{- end }} + {{- tpl (toYaml $installContainers) $ | nindent 2 }} + {{- end }} + {{- 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 }} + {{- $upgradeContainers = append $upgradeContainers $container }} + {{- end }} + {{- tpl (toYaml $upgradeContainers) $ | nindent 2 }} + {{- end }} + {{- end }} {{- if .Values.initContainers }} {{- $initContainers := list }} {{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }} @@ -63,32 +89,6 @@ initContainers: {{- end }} {{- tpl (toYaml $initContainers) $ | nindent 2 }} {{- end }} - {{- if .Release.IsInstall }} - {{- if .Values.installContainers }} - {{- $initContainers := list }} - {{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }} - {{- $container := get $.Values.initContainers $key }} - {{- if not $container.name -}} - {{- $_ := set $container "name" $key }} - {{- end }} - {{- $initContainers = append $initContainers $container }} - {{- end }} - {{- tpl (toYaml $initContainers) $ | nindent 2 }} - {{- end }} - {{- end }} - {{- if .Release.IsUpgrade }} - {{- if .Values.upgradeContainers }} - {{- $initContainers := list }} - {{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }} - {{- $container := get $.Values.initContainers $key }} - {{- if not $container.name -}} - {{- $_ := set $container "name" $key }} - {{- end }} - {{- $initContainers = append $initContainers $container }} - {{- end }} - {{- tpl (toYaml $initContainers) $ | nindent 2 }} - {{- end }} - {{- end }} containers: {{- include "common.controller.mainContainer" . | nindent 2 }} {{- with .Values.additionalContainers }}