Make .Environment values available in .gotmpl files. (#2000)

Currently it's not possible to use `.Environment` values in `*.gomtpl` files. The documentation states the opposite: 
https://github.com/roboll/helmfile#environment (2nd paragraph).
The problem is already described in #1090.
This PR fixes this bug.
Fixes #1090

Co-authored-by: Peter Aichinger <petera@topdesk.com>
This commit is contained in:
pjotre86
2021-11-04 10:04:01 +09:00
committed by GitHub
co-authored by Peter Aichinger
parent 9354c38a0a
commit ca6dd7a60f
5 changed files with 30 additions and 16 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ func (ld *desiredStateLoader) Load(f string, opts LoadOpts) (*state.HelmState, e
storage := state.NewStorage(opts.CalleePath, ld.logger, ld.glob)
envld := state.NewEnvironmentValuesLoader(storage, ld.readFile, ld.logger, ld.remote)
handler := state.MissingFileHandlerError
vals, err := envld.LoadEnvironmentValues(&handler, args)
vals, err := envld.LoadEnvironmentValues(&handler, args, &environment.EmptyEnvironment)
if err != nil {
return nil, err
}