fix env config reads for nested config values

This commit is contained in:
Alex Goodman 2020-07-03 12:00:46 -04:00
parent 466169e8d7
commit 027f71de45
No known key found for this signature in database
GPG key ID: 86E2870463D5E890

View file

@ -121,7 +121,7 @@ func readConfig(v *viper.Viper, configPath string) error {
v.SetEnvPrefix(internal.ApplicationName)
// allow for nested options to be specified via environment variables
// e.g. pod.context = APPNAME_POD_CONTEXT
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
// use explicitly the given user config
if configPath != "" {