diff --git a/incubator/monochart/templates/_helpers.tpl b/incubator/monochart/templates/_helpers.tpl index 3444ba36..91a2e919 100644 --- a/incubator/monochart/templates/_helpers.tpl +++ b/incubator/monochart/templates/_helpers.tpl @@ -23,7 +23,7 @@ Environment template block for deployable resources */}} {{- define "monochart.env" -}} {{- $root := . -}} -{{- if or $root.Values.configMaps $root.Values.secrets }} +{{- if $root.Values.configMaps | or $root.Values.secrets | or $root.Values.envFrom }} envFrom: {{- range $name, $config := $root.Values.configMaps -}} {{- if $config.enabled }} @@ -41,27 +41,26 @@ envFrom: {{- end }} {{- end }} {{- end }} -{{- end }} -{{- with $root.Values.env }} -env: -{{- range $name, $value := . }} - - name: {{ $name }} - value: {{ default "" $value | quote }} -{{- end }} -{{- end }} {{- if $root.Values.envFrom }} -envFrom: {{- with $root.Values.envFrom }} {{- range $name := .configMaps }} - - configMapRef: - name: {{ $name }} +- configMapRef: + name: {{ $name }} {{- end }} {{- range $name := .secrets }} - - secretRef: - name: {{ $name }} +- secretRef: + name: {{ $name }} {{- end }} {{- end }} {{- end -}} +{{- end }} +{{- with $root.Values.env }} +env: +{{- range $name, $value := . }} + - name: {{ $name }} + value: {{ default "" $value | quote }} +{{- end }} +{{- end }} {{- end -}}