Support helmfile template functions - #21
Conversation
Helmfile value files use template functions beyond Helm/Sprig (env, requiredEnv, exec, readFile, fetchSecretValue, ...), which were reported as "function ... not defined" by validateTemplateSyntax. Add helmfileFuncMap() registering stubs for those functions on top of helmFuncMap(), and a helmfile validation mode enabled automatically for .gotmpl files or explicitly via --helmfile (needed for stdin). Coverage is a real template fixture (templates_test/) formatting a .gotmpl values file that uses env/requiredEnv; the stdin path selects helmfile mode from the input extension, exercising validation too. Fixes digitalstudium#16. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
I don't know whether the extra flags are useful nor needed. If we go with the one tool approach, we could also just add the functions to the map and skip the extra arguments/flags |
Let's skip the extra arguments please |
Drop the --helmfile flag and .gotmpl auto-detection; merge helmfile's extra template functions (env, requiredEnv, exec, readFile, ...) into helmFuncMap so helmfmt validates and formats helmfile files by default. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
updated |
|
What AI review added here:
|
|
Yes, it is right. I let it cross check it and found another two functions which are documented but where not listed. Next commit should fix it. |
Remove kustomizeBuild (not a helmfile template function) and add the missing sprigGet alias plus isFile/isDir functions that helmfile exposes in .gotmpl templates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Helmfile value files use template functions beyond Helm/Sprig (env, requiredEnv, exec, readFile, fetchSecretValue, ...), which were reported as "function ... not defined" by validateTemplateSyntax.
Add helmfileFuncMap() registering stubs for those functions on top of helmFuncMap(), and a helmfile validation mode enabled automatically for .gotmpl files or explicitly via --helmfile (needed for stdin).
Fixes #16.