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

Fix extraEnv in gitjob controller template #2650

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Conversation

manno
Copy link
Member

@manno manno commented Jul 18, 2024

Setting debug to false would put the additional env vars outside the env block.

% helm template --set 'extraEnv[0].name="foo"' --set 'extraEnv[0].value="bar"' fleet charts/fleet
Error: YAML parse error on fleet/templates/deployment_gitjob.yaml: error converting YAML to JSON: yaml: line 47: did not find expected key

Use --debug flag to render out invalid YAML

Setting debug to false would put the additional env vars outside the
env block.
@manno manno requested a review from a team as a code owner July 18, 2024 12:33
weyfonk
weyfonk previously approved these changes Jul 18, 2024
Copy link
Contributor

@weyfonk weyfonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦅 👁️ !

@manno
Copy link
Member Author

manno commented Jul 18, 2024

I'm adding an initial setup for https://github.com/helm/chart-testing/blob/main/doc/ct_lint.md

@@ -0,0 +1,2 @@
apiServerURL: "https://localhost"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this file, and other files under charts/fleet{-agent,}/ci end up being packaged in our charts?
Should we add .helmignore files to those charts to prevent that?

Apart from that, I'm sligthly concerned about the maintenance overhead of those values files when we add new features involving such values: it looks likely to me that we may forget to update at least some of them to reflect the latest available values.

Copy link
Member Author

@manno manno Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added those .helmignore files. The actual values in those files don't matter much. I think chart-testing just checks that the result is valid YAML. Not sure if we will ever be able to cover all combinations, but at least this bug would have been catched by the one file with "debug: false".

This adds some example values, especially the helm values affecting
blocks, like `debug` often create problems.
@manno manno force-pushed the fix-extraenv-in-gitjob-template branch from fbb309f to 6c3aff3 Compare July 18, 2024 13:34
@manno manno merged commit 2872615 into main Jul 18, 2024
12 checks passed
@manno manno deleted the fix-extraenv-in-gitjob-template branch July 18, 2024 15:27
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 this pull request may close these issues.

2 participants