etcdmain: fix ignoring of ETCD_CONFIG_FILE env variable

Fixes #10747

Signed-off-by: Andrey Abramov <st5pub@yandex.ru>
release-3.4
Andrey Abramov 2019-05-25 23:54:19 +03:00
parent 2ff2755528
commit 6955331901
1 changed files with 5 additions and 0 deletions

View File

@ -283,6 +283,11 @@ func (cfg *config) parse(arguments []string) error {
}
var err error
if cfg.configFile == "" {
cfg.configFile = os.Getenv("ETCD_CONFIG_FILE")
}
if cfg.configFile != "" {
err = cfg.configFromFile(cfg.configFile)
if lg := cfg.ec.GetLogger(); lg != nil {