Applying the below chart results in an error.
Chart...
repositories:
- name: chartmuseum
url: https://chartmuseum.fitfit.dk
releases:
- name: whoami
namespace: whoami
chart: chartmuseum/whoami-release
# chart: chartmuseum/whoami-{{ requiredEnv "STAGE" }}
helmDefaults:
recreatePods: true
force: true
Command and error...
$ helm tiller run helmfile -f whoami.yaml apply
Installed Helm version v2.12.1
Installed Tiller version v2.12.1
Helm and Tiller are the same version!
Starting Tiller...
Tiller namespace: kube-system
Running: helmfile -f whoami.yaml apply
error during whoami.yaml parsing: template: stringTemplate:9:34: executing "stringTemplate" at <requiredEnv "STAGE">: error calling requiredEnv: required env var `STAGE` is not set
Stopping Tiller...
Error: plugin "tiller" exited with error
I'm thinking that since the requiredEnv function (?) is within a comment it should be ignored.
@tonsV2 Hey! Thanks for reporting.
Unfortunately, this can't be fixed.
Your whoami.yaml is basically a golang text/template, which is firstly executed to produce a YAML data. If we reverse the ordering, many of the helmfile yaml files fail due to that a template file isn't usually a valid YAML file.
If you just a whatever way to comment things out, {{* .... *}} can be used instead.
Thanks for pointing out an alternative solution
@tonsV2 Thanks for checking-in! Hope it helps. Please feel free to leave any comment in case something went wrong!
That asterisk commenting does not work:
error during helmfile.yaml parsing: template: stringTemplate:51: unexpected "*" in command
@Morriz Sry I misread the golang text/template doc, but it seems like you should use {{/* whatever */}} instead
Most helpful comment
Thanks for pointing out an alternative solution