-
Notifications
You must be signed in to change notification settings - Fork 564
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
Error when values template uses Files.Get to read a file #757
Comments
@smeierhofer Hey! Files.Get nor Fields.Glob don't exist in helmfile. But |
Hey mumoshu. Thanks much for the solution! I want to do something similar with Files.Glob and the tpl function. I want the following in a values template referenced by a Helmfile release: configData:
{{ (tpl (.Files.Glob "config/*").AsConfig . ) | indent 2 }} And the Helm Chart defines a ConfigMap with the following: data:
{{ toYaml .Values.configData | indent 2 }} The ConfigMap is mounted into a container which makes all the config files specified by the Helmfile release available to the container. The container reads the config files to determine its configuration. FYI, the reason to use the tpl function is because I want to use Go Template syntax the config files to include other files as a way to re-use some portions of those config across releases. |
@smeierhofer Sounds great! Would you mind creating a dedicated feature request for that? |
Also, probably it would be nicer to name |
I created an issue #761 but not sure how to label it as a feature request. |
Closed issue as I have created the feature request. |
My helmfile release uses the values template values.yaml.gotmpl, which contains the following
The intent is that this reads the binary file and makes it available to the Helm Chart.
The Helm Chart uses this value in a ConfigMap as follows:
And then mounts the ConfigMap onto a path in a container. So then the container reads the "license.bin" file specified by the Helmfile.
But when I run "helmfile sync" I get the following error
in ./helmfile.yaml: failed processing release my-release: failed to render values files "values.yaml.gotmpl": failed to render [values.yaml.gotmpl], because of template: stringTemplate:14:24: executing "stringTemplate" at <.Files.Get>: can't evaluate field Files in type state.EnvironmentTemplateData
Am I allowed to use Files.Get and Files.Glob in a Helmfile values template just like I am from a template in the Helm Chart?
The text was updated successfully, but these errors were encountered: