roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.05k stars 565 forks source link

Template values set to "off" are redered as "false" #2141

Open readverish opened 2 years ago

readverish commented 2 years ago

When setting a value to "off" in a values template, the rendered manifests contains a value "false".

Example: headers: {{ .Values | get "env.headers" "off" }}

Is rendered as: headers: "false"

when running helmfile template. This is the case whether the environment file has env.headers set to "off" or not set at all (takes the default).

I also tried setting the value to "on", and it sets it to "true".

mumoshu commented 2 years ago

@readverish Hey! You seem to have discovered how YAML works. Was your goal to literally say off, not the bool value? Then use "off" or "on". In Go template you can use quote to add double-quotes around the input, so you might find this handy: {{ .Values | get "env.headers" "off" | quote }}.