mirror of
https://ghproxy.com/https://github.com/truecharts/charts.git
synced 2026-07-27 13:40:18 +08:00
feat(common): add upgrade and install specific initContainers
This commit is contained in:
@@ -15,4 +15,4 @@ maintainers:
|
||||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 8.13.5
|
||||
version: 8.14.0
|
||||
|
||||
@@ -63,6 +63,32 @@ 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 }}
|
||||
|
||||
@@ -334,6 +334,12 @@ securityContext:
|
||||
# -- Configure the lifecycle for the main container
|
||||
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.
|
||||
# The dictionary item key will determine the order. Helm templates can be used.
|
||||
initContainers: {}
|
||||
|
||||
Reference in New Issue
Block a user