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

Do not complain about missing value in values.yaml inside "default" template call #72

Open
SivkovSavely opened this issue Dec 26, 2024 · 2 comments

Comments

@SivkovSavely
Copy link

Hi, when I do a template call like this:

some-key: "{{ default .Values.someValue "some fallback" }}"

and do not provide "someValue" in values.yaml, this extension complains about the lack of the value.

while this makes sense when I just try to render the value, it doesn't make sense when there's a "default" clause.

at least when there is already a parent of the value present, e.g. this should be considered valid:

values.yaml:

app:
    test:
        abc: 123

pod.yaml:

key: {{ default .Values.app.test.def 456 }}

it's supposed to be valid because we have "app.test" object in values.yaml, therefore helm will not give an error here, but instead it will fall back to 456.

while this is invalid:

values.yaml:

app:
    some-other-key: 123

pod.yaml:

key: {{ default .Values.app.test.def 456 }}

because there is no "app.test" object in values.yaml, and helm will rightfully complain here, even though we use the default clause. so the extension could still show an error here.

but not in the previous example.

@SivkovSavely
Copy link
Author

I did a little oopsie-daisy, the actual order of arguments of "default" should be swapped, but it didn't solve the problem, so the original problem still stands.

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
@SivkovSavely and others