mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common)!: Release v3.0.0-beta1 (#278)
This commit is contained in:
parent
deafcf75a1
commit
b78483b0b8
88 changed files with 3697 additions and 1209 deletions
|
@ -13,10 +13,6 @@ Returns the value for containers
|
|||
{{- $enabledContainers := include "bjw-s.common.lib.controller.enabledContainers" (dict "rootContext" $rootContext "controllerObject" $controllerObject) | fromYaml }}
|
||||
{{- $renderedContainers := dict -}}
|
||||
|
||||
{{- /* TODO: Remove this logic after "order" removal in v3 */ -}}
|
||||
{{- $containersWithDependsOn := include "bjw-s.common.lib.getMapItemsWithKey" (dict "map" $enabledContainers "key" "dependsOn") | fromYaml | keys -}}
|
||||
{{- $useDependsOn := gt (len $containersWithDependsOn) 0 -}}
|
||||
|
||||
{{- range $key, $containerValues := $enabledContainers -}}
|
||||
{{- /* Create object from the container values */ -}}
|
||||
{{- $containerObject := (include "bjw-s.common.lib.container.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $containerValues)) | fromYaml -}}
|
||||
|
@ -29,40 +25,23 @@ Returns the value for containers
|
|||
{{- $_ := set $renderedContainers $key $renderedContainer -}}
|
||||
|
||||
{{- /* Determine the Container order */ -}}
|
||||
{{- if $useDependsOn -}}
|
||||
{{- if empty (dig "dependsOn" nil $containerValues) -}}
|
||||
{{- $_ := set $graph $key ( list ) -}}
|
||||
{{- else if kindIs "string" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key ( list $containerValues.dependsOn ) -}}
|
||||
{{- else if kindIs "slice" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key $containerValues.dependsOn -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- /* TODO: Remove this logic after "order" removal in v3 */ -}}
|
||||
{{- $containerOrder := (dig "order" 99 $containerValues) -}}
|
||||
{{- $_ := set $graph $key $containerOrder -}}
|
||||
{{- if empty (dig "dependsOn" nil $containerValues) -}}
|
||||
{{- $_ := set $graph $key ( list ) -}}
|
||||
{{- else if kindIs "string" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key ( list $containerValues.dependsOn ) -}}
|
||||
{{- else if kindIs "slice" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key $containerValues.dependsOn -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Process graph */ -}}
|
||||
{{- if $useDependsOn -}}
|
||||
{{- $args := dict "graph" $graph "out" list -}}
|
||||
{{- include "bjw-s.common.lib.kahn" $args -}}
|
||||
{{- $args := dict "graph" $graph "out" list -}}
|
||||
{{- include "bjw-s.common.lib.kahn" $args -}}
|
||||
|
||||
{{- range $name := $args.out -}}
|
||||
{{- $containerItem := get $renderedContainers $name -}}
|
||||
{{- $containers = append $containers $containerItem -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- /* TODO: Remove this logic after "order" removal in v3 */ -}}
|
||||
{{- $orderedContainers := dict -}}
|
||||
{{- range $key, $order := $graph -}}
|
||||
{{- $containerItem := get $renderedContainers $key -}}
|
||||
{{- $_ := set $orderedContainers (printf "%v-%s" $order $key) $containerItem -}}
|
||||
{{- end -}}
|
||||
{{- range $key, $containerValues := $orderedContainers -}}
|
||||
{{- $containers = append $containers $containerValues -}}
|
||||
{{- end -}}
|
||||
{{- range $name := $args.out -}}
|
||||
{{- $containerItem := get $renderedContainers $name -}}
|
||||
{{- $containers = append $containers $containerItem -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty $containers) -}}
|
||||
|
|
|
@ -9,13 +9,13 @@ Returns the value for dnsPolicy
|
|||
{{- $dnsPolicy := "ClusterFirst" -}}
|
||||
|
||||
{{- /* Get hostNetwork value "" */ -}}
|
||||
{{- $hostNetwork:= get $controllerObject.pod "hostNetwork" -}}
|
||||
{{- if $hostNetwork -}}
|
||||
{{- $hostNetwork:= include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "hostNetwork") -}}
|
||||
{{- if (eq $hostNetwork "true") -}}
|
||||
{{- $dnsPolicy = "ClusterFirstWithHostNet" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* See if an override is desired */ -}}
|
||||
{{- $override := get $controllerObject.pod "dnsPolicy" -}}
|
||||
{{- $override := include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "dnsPolicy") -}}
|
||||
|
||||
{{- if not (empty $override) -}}
|
||||
{{- $dnsPolicy = $override -}}
|
||||
|
|
|
@ -12,10 +12,6 @@ Returns the value for initContainers
|
|||
{{- /* Fetch configured containers for this controller */ -}}
|
||||
{{- $renderedContainers := dict -}}
|
||||
|
||||
{{- /* TODO: Remove this logic after "order" removal in v3 */ -}}
|
||||
{{- $containersWithDependsOn := include "bjw-s.common.lib.getMapItemsWithKey" (dict "map" $controllerObject.initContainers "key" "dependsOn") | fromYaml | keys -}}
|
||||
{{- $useDependsOn := gt (len $containersWithDependsOn) 0 -}}
|
||||
|
||||
{{- range $key, $containerValues := $controllerObject.initContainers -}}
|
||||
{{- /* Enable container by default, but allow override */ -}}
|
||||
{{- $containerEnabled := true -}}
|
||||
|
@ -35,41 +31,23 @@ Returns the value for initContainers
|
|||
{{- $_ := set $renderedContainers $key $renderedContainer -}}
|
||||
|
||||
{{- /* Determine the Container order */ -}}
|
||||
{{- if $useDependsOn -}}
|
||||
{{- if empty (dig "dependsOn" nil $containerValues) -}}
|
||||
{{- $_ := set $graph $key ( list ) -}}
|
||||
{{- else if kindIs "string" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key ( list $containerValues.dependsOn ) -}}
|
||||
{{- else if kindIs "slice" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key $containerValues.dependsOn -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- /* TODO: Remove this logic after "order" removal in v3 */ -}}
|
||||
{{- $containerOrder := (dig "order" 99 $containerValues) -}}
|
||||
{{- $_ := set $graph $key $containerOrder -}}
|
||||
{{- if empty (dig "dependsOn" nil $containerValues) -}}
|
||||
{{- $_ := set $graph $key ( list ) -}}
|
||||
{{- else if kindIs "string" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key ( list $containerValues.dependsOn ) -}}
|
||||
{{- else if kindIs "slice" $containerValues.dependsOn -}}
|
||||
{{- $_ := set $graph $key $containerValues.dependsOn -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Process graph */ -}}
|
||||
{{- if $useDependsOn -}}
|
||||
{{- $args := dict "graph" $graph "out" list -}}
|
||||
{{- include "bjw-s.common.lib.kahn" $args -}}
|
||||
{{- $args := dict "graph" $graph "out" list -}}
|
||||
{{- include "bjw-s.common.lib.kahn" $args -}}
|
||||
|
||||
{{- range $name := $args.out -}}
|
||||
{{- $containerItem := get $renderedContainers $name -}}
|
||||
{{- $containers = append $containers $containerItem -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- /* TODO: Remove this logic after "order" removal in v3 */ -}}
|
||||
{{- $orderedContainers := dict -}}
|
||||
{{- range $key, $order := $graph -}}
|
||||
{{- $containerItem := get $renderedContainers $key -}}
|
||||
{{- $_ := set $orderedContainers (printf "%v-%s" $order $key) $containerItem -}}
|
||||
{{- end -}}
|
||||
{{- range $key, $containerValues := $orderedContainers -}}
|
||||
{{- $containers = append $containers $containerValues -}}
|
||||
{{- end -}}
|
||||
{{- range $name := $args.out -}}
|
||||
{{- $containerItem := get $renderedContainers $name -}}
|
||||
{{- $containers = append $containers $containerItem -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty $containers) -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue