Skip to content

Support helmfile template functions - #21

Draft
DanielHabenicht wants to merge 2 commits into
digitalstudium:mainfrom
DanielHabenicht:support-helmfile-functions
Draft

Support helmfile template functions#21
DanielHabenicht wants to merge 2 commits into
digitalstudium:mainfrom
DanielHabenicht:support-helmfile-functions

Conversation

@DanielHabenicht

@DanielHabenicht DanielHabenicht commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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.

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>
@DanielHabenicht

Copy link
Copy Markdown
Contributor Author

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

@digitalstudium

Copy link
Copy Markdown
Owner

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>
@DanielHabenichtWork

Copy link
Copy Markdown
Contributor

Let's skip the extra arguments please

updated

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.

Support helmfile functions

3 participants