github.com/zsuzhengdu/helm@v3.0.0-beta.3+incompatible/cmd/helm/testdata/testcharts/lib-chart/templates/_envvar.tpl (about) 1 {{- define "common.envvar.value" -}} 2 {{- $name := index . 0 -}} 3 {{- $value := index . 1 -}} 4 5 name: {{ $name }} 6 value: {{ default "" $value | quote }} 7 {{- end -}} 8 9 {{- define "common.envvar.configmap" -}} 10 {{- $name := index . 0 -}} 11 {{- $configMapName := index . 1 -}} 12 {{- $configMapKey := index . 2 -}} 13 14 name: {{ $name }} 15 valueFrom: 16 configMapKeyRef: 17 name: {{ $configMapName }} 18 key: {{ $configMapKey }} 19 {{- end -}} 20 21 {{- define "common.envvar.secret" -}} 22 {{- $name := index . 0 -}} 23 {{- $secretName := index . 1 -}} 24 {{- $secretKey := index . 2 -}} 25 26 name: {{ $name }} 27 valueFrom: 28 secretKeyRef: 29 name: {{ $secretName }} 30 key: {{ $secretKey }} 31 {{- end -}}