mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release version 2.0.0-beta.1 (#173)
This commit is contained in:
parent
19767d668c
commit
7b6ee00be6
189 changed files with 3110 additions and 3023 deletions
34
charts/library/common/templates/lib/pod/_getOption.tpl
Normal file
34
charts/library/common/templates/lib/pod/_getOption.tpl
Normal file
|
@ -0,0 +1,34 @@
|
|||
{{- /*
|
||||
Returns the value for the specified field
|
||||
*/ -}}
|
||||
{{- define "bjw-s.common.lib.pod.getOption" -}}
|
||||
{{- $rootContext := .ctx.rootContext -}}
|
||||
{{- $controllerObject := .ctx.controllerObject -}}
|
||||
{{- $option := .option -}}
|
||||
|
||||
{{- $value := "" -}}
|
||||
|
||||
{{- /* Set to the default if it is set */ -}}
|
||||
{{- $defaultOption := get $rootContext.Values.defaultPodOptions $option -}}
|
||||
{{- if kindIs "bool" $defaultOption -}}
|
||||
{{- $value = $defaultOption -}}
|
||||
{{- else if not (empty $defaultOption) -}}
|
||||
{{- $value = $defaultOption -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* See if a pod-specific override is needed */ -}}
|
||||
{{- if hasKey $controllerObject "pod" -}}
|
||||
{{- $podOption := get $controllerObject.pod $option -}}
|
||||
{{- if kindIs "bool" $podOption -}}
|
||||
{{- $value = $podOption -}}
|
||||
{{- else if not (empty $podOption) -}}
|
||||
{{- $value = $podOption -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if kindIs "bool" $value -}}
|
||||
{{- $value | toYaml -}}
|
||||
{{- else if not (empty $value) -}}
|
||||
{{- $value | toYaml -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue