Skip to content

Commit

Permalink
Merge pull request #10762 from FrozenAndrey/fix#10747
Browse files Browse the repository at this point in the history
etcdmain: fix ignoring of ETCD_CONFIG_FILE env variable
  • Loading branch information
xiang90 authored Jun 8, 2019
2 parents f6a9ebe + 14c5eaa commit ea70731
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions etcdmain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ea70731

Please sign in to comment.