feat(common): add upgrade and install specific initContainers
This commit is contained in:
@@ -15,4 +15,4 @@ maintainers:
|
|||||||
name: common
|
name: common
|
||||||
sources: null
|
sources: null
|
||||||
type: library
|
type: library
|
||||||
version: 8.13.5
|
version: 8.14.0
|
||||||
|
|||||||
@@ -63,6 +63,32 @@ initContainers:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
|
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
|
||||||
{{- end }}
|
{{- 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:
|
containers:
|
||||||
{{- include "common.controller.mainContainer" . | nindent 2 }}
|
{{- include "common.controller.mainContainer" . | nindent 2 }}
|
||||||
{{- with .Values.additionalContainers }}
|
{{- with .Values.additionalContainers }}
|
||||||
|
|||||||
@@ -334,6 +334,12 @@ securityContext:
|
|||||||
# -- Configure the lifecycle for the main container
|
# -- Configure the lifecycle for the main container
|
||||||
lifecycle: {}
|
lifecycle: {}
|
||||||
|
|
||||||
|
# -- These containers will be run, as an initcontainer, a single time at install only.
|
||||||
|
installContainers: {}
|
||||||
|
|
||||||
|
# -- These containers will be run, as an initcontainer, a single time at each edit or update of the chart.
|
||||||
|
upgradeContainers: {}
|
||||||
|
|
||||||
# -- Specify any initContainers here as dictionary items. Each initContainer should have its own key.
|
# -- Specify any initContainers here as dictionary items. Each initContainer should have its own key.
|
||||||
# The dictionary item key will determine the order. Helm templates can be used.
|
# The dictionary item key will determine the order. Helm templates can be used.
|
||||||
initContainers: {}
|
initContainers: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user