Suggested edit to simple conditional example

If drink is null or commented out in values.yaml, you need to check for existence or helm will throw an error as below:

error calling eq: invalid type for comparison

This change handles null or missing dring attribute in values.yaml which is commented out in a previous step in the quick start.
pull/2980/head
Richard Guthrie 8 years ago committed by GitHub
parent 2b32fa4457
commit 1c71fd24e0

@ -53,7 +53,7 @@ data:
myvalue: "Hello World"
drink: {{ .Values.favorite.drink | default "tea" | quote }}
food: {{ .Values.favorite.food | upper | quote }}
{{ if eq .Values.favorite.drink "coffee" }}mug: true{{ end }}
{{ if ( .Values.favorite.drink ) and eq .Values.favorite.drink "coffee" }}mug: true{{ end }}
```
Since we commented out `drink: coffee` in our last example, the output should not include a `mug: true` flag. But if we add that line back into our `values.yaml` file, the output should look like this:

Loading…
Cancel
Save