Merge pull request #2460 from robermorales/patch-1

Improve error message in case invalid env var found
This commit is contained in:
João Pereira 2021-11-25 13:36:00 +00:00 committed by GitHub
commit cc4627fc6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -206,6 +206,7 @@ func (p *Parser) overwriteStruct(v reflect.Value, fullpath string, path []string
fieldVal := reflect.New(sf.Type)
err := yaml.Unmarshal([]byte(payload), fieldVal.Interface())
if err != nil {
logrus.Warnf("Error parsing environment variable %s: %s", fullpath, err)
return err
}
field.Set(reflect.Indirect(fieldVal))