etcdmain: fix ignoring of ETCD_CONFIG_FILE env variable
release-3.4
Xiang Li 2019-06-07 21:32:35 -07:00 committed by GitHub
commit ea70731f53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -284,6 +284,14 @@ func (cfg *config) parse(arguments []string) error {
}
var err error
// This env variable must be parsed separately
// because we need to determine whether to use or
// ignore the env variables based on if the config file is set.
if cfg.configFile == "" {
cfg.configFile = os.Getenv(flags.FlagToEnv("ETCD", "config-file"))
}
if cfg.configFile != "" {
err = cfg.configFromFile(cfg.configFile)
if lg := cfg.ec.GetLogger(); lg != nil {