From acb8b2bfef1ff5fca53ab271d9fed536156ada3c Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 22 Dec 2022 18:30:53 +0200 Subject: [PATCH] attach env and env from on initcontianer --- .../1.0.0/templates/lib/pod/_initContainers.tpl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/common/1.0.0/templates/lib/pod/_initContainers.tpl b/library/common/1.0.0/templates/lib/pod/_initContainers.tpl index 4267b260ce..e4555e37f7 100644 --- a/library/common/1.0.0/templates/lib/pod/_initContainers.tpl +++ b/library/common/1.0.0/templates/lib/pod/_initContainers.tpl @@ -8,8 +8,9 @@ {{- end -}} {{- if ne $name ($name | lower) -}} {{- fail (printf "Name (%s) of Init Container must be all lowercase" $name) -}} - {{- end }} -- name: {{ printf "%s-%s" (include "ix.v1.common.names.fullname" $root) $name }} + {{- end -}} + {{- $name = (printf "%s-%s" (include "ix.v1.common.names.fullname" $root) $name) }} +- name: {{ $name }} image: {{ include "ix.v1.common.images.selector" (dict "root" $root "selectedImage" $container.imageSelector ) }} imagePullPolicy: {{ include "ix.v1.common.images.pullPolicy" (dict "policy" $container.pullPolicy) }} tty: {{ $container.tty | default false }} @@ -22,6 +23,14 @@ args: {{- . | nindent 4 }} {{- end -}} + {{- with (include "ix.v1.common.container.envVars" (dict "envs" $container.env "envList" $container.envList "container" $name "root" $root) | trim) }} + env: + {{- . | nindent 4 }} {{/* env, fixedEnvs and envList */}} + {{- end -}} + {{- with (include "ix.v1.common.container.envFrom" (dict "envFrom" $container.envFrom "container" $name "root" $root) | trim) }} + envFrom: + {{- . | nindent 4 }} + {{- end -}} {{- with (include "ix.v1.common.container.lifecycle" (dict "lifecycle" $container.lifecycle "root" $root)) | trim }} lifecycle: {{- . | nindent 4 }}