Closed hinricht closed 2 months ago
Ah, found the solution: https://stackoverflow.com/a/72347561
In the range block . refers to the current value in the execution time. Instead of . you can use $ to access to the root data object in the range block instead of declaring top level variables.
So inside the range block I need to specify {{$.Env.TEST}}
instead of {{.Env.TEST}}
in order to make it work.
Describe the bug
I can use
{{.Env.foo}}
fine when using it in a simple command section, but when I use it in a Template range it won't render.How To Reproduce
This works:
But when I add
{{.Env.TEST}}'
inside the{{range .Vars.foo}}
it won't render:Expected Behavior
Env variables should render find, no matter if they are inside a range.
Actual Behavior
Environment: