helmfile icon indicating copy to clipboard operation
helmfile copied to clipboard

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

Open readverish opened this issue 3 years ago • 1 comments

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".

readverish avatar May 20 '22 16:05 readverish

@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 }}.

mumoshu avatar May 21 '22 07:05 mumoshu