mirror of
https://github.com/truenas/charts.git
synced 2026-04-02 02:10:37 +08:00
Have a line break between rendering environment variables
This commit is contained in:
@@ -1,3 +1,23 @@
|
||||
{{/*
|
||||
Render environment variable
|
||||
*/}}
|
||||
{{- define "common.containers.environmentVariable" -}}
|
||||
{{- $envVariable := . -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "name")) -}}
|
||||
{{- if $envVariable.valueFromSecret -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "secretName" "secretKey")) -}}
|
||||
- name: {{ $envVariable.name }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $envVariable.secretName }}
|
||||
key: {{ $envVariable.secretKey }}
|
||||
{{- else -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "value")) -}}
|
||||
- name: {{ $envVariable.name }}
|
||||
value: {{ $envVariable.value }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Render environment variables
|
||||
*/}}
|
||||
@@ -5,17 +25,6 @@ Render environment variables
|
||||
{{- $values := . -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}}
|
||||
{{- range $envVariable := $values.environmentVariables -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "name")) -}}
|
||||
- name: {{ $envVariable.name }}
|
||||
{{- if $envVariable.valueFromSecret -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "secretName" "secretKey")) -}}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $envVariable.secretName }}
|
||||
key: {{ $envVariable.secretKey }}
|
||||
{{- else -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "value")) -}}
|
||||
value: {{ $envVariable.value }}
|
||||
{{- end -}}
|
||||
{{- include "common.containers.environmentVariable" $envVariable | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user