Skip to content

Commit

Permalink
[monochart] Update envFrom (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh authored Jul 16, 2020
1 parent 527aca3 commit f52c7f9
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions incubator/monochart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 -}}


Expand Down

0 comments on commit f52c7f9

Please sign in to comment.