Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
readverish opened this issue May 20, 2022 · 1 comment
Open

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

readverish opened this issue May 20, 2022 · 1 comment

Comments

@readverish
Copy link

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
Copy link
Collaborator

mumoshu commented May 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants