mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release v2.5.0 (#258)
Co-authored-by: Maurits <75321636+maurits-funda@users.noreply.github.com> Co-authored-by: Noam Lerner <bugok@users.noreply.github.com>
This commit is contained in:
parent
1582fe27c4
commit
a548690b00
25 changed files with 670 additions and 56 deletions
|
@ -36,8 +36,8 @@ terminationMessagePolicy: {{ . | trim }}
|
|||
{{- with (include "bjw-s.common.lib.container.field.env" (dict "ctx" $ctx) | trim) }}
|
||||
env: {{ . | trim | nindent 2 }}
|
||||
{{- end -}}
|
||||
{{- with $containerObject.envFrom }}
|
||||
envFrom: {{ toYaml . | trim | nindent 2 }}
|
||||
{{- with (include "bjw-s.common.lib.container.field.envFrom" (dict "ctx" $ctx) | trim) }}
|
||||
envFrom: {{ . | trim | nindent 2 }}
|
||||
{{- end -}}
|
||||
{{- with $containerObject.ports }}
|
||||
ports: {{ toYaml . | trim | nindent 2 }}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
{{/*
|
||||
Env field used by the container.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.container.field.envFrom" -}}
|
||||
{{- $ctx := .ctx -}}
|
||||
{{- $rootContext := $ctx.rootContext -}}
|
||||
{{- $containerObject := $ctx.containerObject -}}
|
||||
|
||||
{{- if not (empty (get $containerObject "envFrom")) -}}
|
||||
{{- $envFrom := list -}}
|
||||
{{- range $containerObject.envFrom -}}
|
||||
{{- $item := dict -}}
|
||||
|
||||
{{- if hasKey . "configMap" -}}
|
||||
{{- $configMap := include "bjw-s.common.lib.configMap.getByIdentifier" (dict "rootContext" $rootContext "id" .configMap) | fromYaml -}}
|
||||
{{- $configMapName := default (tpl .configMap $rootContext) $configMap.name -}}
|
||||
{{- $_ := set $item "configMapRef" (dict "name" $configMapName) -}}
|
||||
{{- else if hasKey . "configMapRef" -}}
|
||||
{{- if not (empty (dig "identifier" nil .configMapRef)) -}}
|
||||
{{- $configMap := include "bjw-s.common.lib.configMap.getByIdentifier" (dict "rootContext" $rootContext "id" .configMapRef.identifier) | fromYaml -}}
|
||||
{{- if empty $configMap -}}
|
||||
{{- fail (printf "No configMap configured with identifier '%s'" .configMapRef.identifier) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $_ := set $item "configMapRef" (dict "name" $configMap.name) -}}
|
||||
{{- else -}}
|
||||
{{- $_ := set $item "configMapRef" (dict "name" (tpl .configMapRef.name $rootContext)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if hasKey . "secret" -}}
|
||||
{{- $secret := include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" .secret) | fromYaml -}}
|
||||
{{- $secretName := default (tpl .secret $rootContext) $secret.name -}}
|
||||
{{- $_ := set $item "secretRef" (dict "name" $secretName) -}}
|
||||
{{- else if hasKey . "secretRef" -}}
|
||||
{{- if not (empty (dig "identifier" nil .secretRef)) -}}
|
||||
{{- $secret := include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" .secretRef.identifier) | fromYaml -}}
|
||||
{{- if empty $secret -}}
|
||||
{{- fail (printf "No secret configured with identifier '%s'" .secretRef.identifier) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $_ := set $item "secretRef" (dict "name" $secret.name) -}}
|
||||
{{- else -}}
|
||||
{{- $_ := set $item "secretRef" (dict "name" (tpl .secretRef.name $rootContext)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty (dig "prefix" nil .)) -}}
|
||||
{{- $_ := set $item "prefix" .prefix -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty $item) -}}
|
||||
{{- $envFrom = append $envFrom $item -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $envFrom | toYaml -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -91,6 +91,12 @@ volumeMounts used by the container.
|
|||
{{- $_ := set $volumeMount "readOnly" $readOnly -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Use the specified mountPropagation setting if provided */ -}}
|
||||
{{- with .mountPropagation -}}
|
||||
{{- $mountPropagation := . -}}
|
||||
{{- $_ := set $volumeMount "mountPropagation" $mountPropagation -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledVolumeMounts = append $enabledVolumeMounts $volumeMount -}}
|
||||
{{- end -}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue