fix env value lost in environment values (#605)

* fix env value lost in environment values

Signed-off-by: yxxhero <aiopsclub@163.com>

* add more test

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2022-12-27 09:48:07 +08:00
committed by GitHub
parent 6664f01596
commit d8cb740dcf
12 changed files with 111 additions and 15 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ func NewEnvironmentValuesLoader(storage *Storage, fs *filesystem.FileSystem, log
}
}
func (ld *EnvironmentValuesLoader) LoadEnvironmentValues(missingFileHandler *string, valuesEntries []interface{}, ctxEnv *environment.Environment) (map[string]interface{}, error) {
func (ld *EnvironmentValuesLoader) LoadEnvironmentValues(missingFileHandler *string, valuesEntries []interface{}, ctxEnv *environment.Environment, envName string) (map[string]interface{}, error) {
result := map[string]interface{}{}
for _, entry := range valuesEntries {
@@ -59,7 +59,7 @@ func (ld *EnvironmentValuesLoader) LoadEnvironmentValues(missingFileHandler *str
for _, f := range files {
var env environment.Environment
if ctxEnv == nil {
env = environment.EmptyEnvironment
env = *environment.New(envName)
} else {
env = *ctxEnv
}