mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
feat: Bump common library to v3.4.0 (#349)
This commit is contained in:
parent
a78c21ab00
commit
86062681a9
45 changed files with 1023 additions and 149 deletions
|
@ -3,11 +3,39 @@ Convert container values to an object
|
|||
*/}}
|
||||
{{- define "bjw-s.common.lib.container.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $controllerObject := mustDeepCopy .controllerObject -}}
|
||||
{{- $containerType := .containerType -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
{{- $objectValues := mustDeepCopy .values -}}
|
||||
{{- $defaultContainerOptionsStrategy := dig "defaultContainerOptionsStrategy" "overwrite" $controllerObject -}}
|
||||
{{- $mergeDefaultContainerOptions := true -}}
|
||||
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Allow disabling default options for initContainers */ -}}
|
||||
{{- if (eq "init" $containerType) -}}
|
||||
{{- $applyDefaultContainerOptionsToInitContainers := dig "applyDefaultContainerOptionsToInitContainers" true $controllerObject -}}
|
||||
{{- if (not (eq $applyDefaultContainerOptionsToInitContainers true)) -}}
|
||||
{{- $mergeDefaultContainerOptions = false -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Merge default container options if required */ -}}
|
||||
{{- if (eq true $mergeDefaultContainerOptions) -}}
|
||||
{{- if eq "overwrite" $defaultContainerOptionsStrategy -}}
|
||||
{{- range $key, $defaultValue := (dig "defaultContainerOptions" dict $controllerObject) }}
|
||||
{{- $specificValue := dig $key nil $objectValues -}}
|
||||
{{- if not (empty $specificValue) -}}
|
||||
{{- $_ := set $objectValues $key $specificValue -}}
|
||||
{{- else -}}
|
||||
{{- $_ := set $objectValues $key $defaultValue -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else if eq "merge" $defaultContainerOptionsStrategy -}}
|
||||
{{- $objectValues = merge $objectValues (dig "defaultContainerOptions" dict $controllerObject) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Process image tags */ -}}
|
||||
{{- if kindIs "map" $objectValues.image -}}
|
||||
{{- $imageTag := dig "image" "tag" "" $objectValues -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue