mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
feat(common): Release 2.0.0-beta.2 (#176)
This commit is contained in:
parent
ed407c00df
commit
9928235b84
80 changed files with 1306 additions and 161 deletions
|
@ -6,19 +6,34 @@ Returns the value for initContainers
|
|||
{{- $controllerObject := .ctx.controllerObject -}}
|
||||
|
||||
{{- /* Default to empty list */ -}}
|
||||
{{- $orderedContainers := dict -}}
|
||||
{{- $containers := list -}}
|
||||
|
||||
{{- /* Fetch configured containers for this controller */ -}}
|
||||
{{- range $key, $containerValues := $controllerObject.initContainers -}}
|
||||
{{- /* Create object from the container values */ -}}
|
||||
{{- $containerObject := (include "bjw-s.common.lib.container.valuesToObject" (dict "rootContext" $ "id" $key "values" $containerValues)) | fromYaml -}}
|
||||
{{- /* Enable container by default, but allow override */ -}}
|
||||
{{- $containerEnabled := true -}}
|
||||
{{- if hasKey $containerValues "enabled" -}}
|
||||
{{- $containerEnabled = $containerValues.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Perform validations on the Container before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.container.validate" (dict "rootContext" $ "object" $containerObject) -}}
|
||||
{{- if $containerEnabled -}}
|
||||
{{- /* Create object from the container values */ -}}
|
||||
{{- $containerObject := (include "bjw-s.common.lib.container.valuesToObject" (dict "rootContext" $ "id" $key "values" $containerValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Generate the Container spec */ -}}
|
||||
{{- $renderedContainer := include "bjw-s.common.lib.container.spec" (dict "rootContext" $rootContext "containerObject" $containerObject) | fromYaml -}}
|
||||
{{- $containers = append $containers $renderedContainer -}}
|
||||
{{- /* Perform validations on the Container before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.container.validate" (dict "rootContext" $ "object" $containerObject) -}}
|
||||
|
||||
{{- /* Generate the Container spec */ -}}
|
||||
{{- $renderedContainer := include "bjw-s.common.lib.container.spec" (dict "rootContext" $rootContext "containerObject" $containerObject) | fromYaml -}}
|
||||
|
||||
{{- $containerOrder := (dig "order" 99 $containerValues) -}}
|
||||
{{- $_ := set $orderedContainers (printf "%v-%s" $containerOrder $key) $renderedContainer -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $key, $containerValues := $orderedContainers -}}
|
||||
{{- $containers = append $containers $containerValues -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty $containers) -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue