-
Notifications
You must be signed in to change notification settings - Fork 548
Open
Description
The section Flow Control of the Chart Template Guide has this listing:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
myvalue: "Hello World"
{{- with .Values.favorite }}
drink: {{ .drink | default "tea" | quote }}
food: {{ .food | upper | quote }}
{{- end }}
In the next paragraph it states:
Note that we removed the
if
conditional from the previous exercise because it is now unnecessary - the block afterwith
only executes if the value ofPIPELINE
is not empty.
However, the now omitted conditional was:
{{- if eq .Values.favorite.drink "coffee" }}
mug: "true"
{{- end }}
That statement does not check if the value is empty but if .drink
matches "coffee".
Has the example been changed without modifying the text or am I missing something here?
In my opinion the example should now be:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
myvalue: "Hello World"
{{- with .Values.favorite }}
drink: {{ .drink | default "tea" | quote }}
food: {{ .food | upper | quote }}
{{- if eq .drink "coffee" }}
mug: true
{{- end }}
{{- end }}
Metadata
Metadata
Assignees
Labels
No labels