Skip to content

Commit

Permalink
feat: fix empty map merge after mergo bump
Browse files Browse the repository at this point in the history
since mergo had been bumped to 0.3.9 an environment value like:
```
affinity: {}
```
was not merged properly (not merged at all) instead it threw an error
that it cannot find the key "affinity" in the environment values even
though it was outputted in debug output as read in properly.
  • Loading branch information
elodani committed Apr 3, 2020
1 parent 51ecd12 commit d404356
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/state/envvals_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (ld *EnvironmentValuesLoader) LoadEnvironmentValues(missingFileHandler *str
if err != nil {
return nil, err
}
if err := mergo.Merge(&result, &vals, mergo.WithOverride); err != nil {
if err := mergo.Merge(&result, &vals, mergo.WithOverride, mergo.WithOverwriteWithEmptyValue); err != nil {
return nil, fmt.Errorf("failed to merge %v: %v", m, err)
}
}
Expand Down

0 comments on commit d404356

Please sign in to comment.