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

Failed to snapshot helm required error output #109

Closed
florianrusch opened this issue May 7, 2024 · 1 comment · Fixed by #110
Closed

Failed to snapshot helm required error output #109

florianrusch opened this issue May 7, 2024 · 1 comment · Fixed by #110

Comments

@florianrusch
Copy link
Contributor

Hello again,

today I wanted to integrate helm-chartsnap into another project where I discovered an edge case that I'm not sure how to handle.

Let's imagine we have a template that contains the following:

testValue: {{ required "testValue is required" .Values.testValue }}

and a values.yaml that contains the following:

testValue:

Executing helm template and also helm chartsnap -c . would now result in the following "error" message:

Error: execution error at (<TEMPLATE_PATH>.yaml:1:3): testValue is required

The question now is, how should I handle this? I don't want to put a default value in the values.yaml because there is no "default" value as the value always depends on the environment the helm chart will applied to.

One idea would be to provide a separate "default" values.yaml file just for chartsnap. But this feels somehow ugly for me. Also I would need to provide testValue in each of my test values.yaml files which is very repetitive.

Another idea would be to somehow provide these kind of values within the .chartsnap.yaml, but I guess that's not supported at the moment, right?

@jlandowner
Copy link
Owner

Hi @florianrusch, thank you for raising!

charsnap should take all the output of helm as snapshot. So What I expect is to successfully snapshot the required error.

It looks charsnap failed to handle helm error exitcode. I will investigate.

@jlandowner jlandowner changed the title How to handle required configs? Failed to snapshot helm required error output May 8, 2024
jlandowner added a commit that referenced this issue May 8, 2024
Close #109

Change default behavior to ignore helm error exitcode with warning.

Also add `--fail-helm-error` flag to keep the previous behavior.
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

Successfully merging a pull request may close this issue.

2 participants