Repository navigation
test(template): pin that a Helm chart commits verbatim (#7) - #20
Merged
Merged
Conversation
#7 reported that committing a Helm chart failed, because fromString was rendered through Go text/template with sprig and Helm's own funcs are not sprig's: create failed: unable to copy files: template: template:61: function "toYaml" not defined That is already fixed, and more cleanly than the issue's own proposal (which was to skip the render when no placeholders are set): the default delimiters moved from {{ }} to {% %}, so Helm's syntax is no longer the delimiter and passes through untouched. The alternatives were tested against real YAML first — << >> breaks on the merge key <<: *defaults, and [[ ]] breaks on flow sequences. What was missing is coverage at the RENDER level. validate_test.go asserts Helm syntax is not *reported* under the default delimiters, but nothing asserted it survives a render byte-for-byte — which is the actual claim #7 is about, and the one a future delimiter change would break. This renders the reported content (toYaml + nindent, include, a {{/* */}} helpers.tpl header, and a .Values reference) and asserts the output is identical to the input. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tUn92TdGikKGEN5opGD7q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7 — as already fixed, with the coverage that was missing.
#7 is fixed, and more cleanly than it proposed
The issue's primary fix was "skip the template render when there are no placeholders." What was actually done is stronger: the default delimiters moved
{{ }}→{% %}, so Helm's syntax is no longer the delimiter and passes through untouched — placeholders or not.The alternatives were tested against real YAML before choosing, per the comment in
template.go:What was missing
Coverage at the render level.
validate_test.goasserts Helm syntax isn't reported under the default delimiters — but nothing asserted it survives a render byte-for-byte, which is the actual claim #7 is about, and exactly what a future delimiter change would silently break.This test
Renders the content that failed on krateo-057 (
publish-sock-shop-003/microservices.yaml):…and asserts the output is identical to the input. That covers all four things #7 listed: the undefined Helm funcs (
toYaml,include), the{{/* */}}headerhelm createwrites into every_helpers.tpland which used to be deleted outright, and.Valuesreferences that used to render to a literal<no value>.Verified failing intent: under
{{ }}delimiters this content errors with exactly the reportedfunction "toYaml" not defined.🤖 Generated with Claude Code
https://claude.ai/code/session_017tUn92TdGikKGEN5opGD7q