Browse Source

etcdmain: fix ignoring of ETCD_CONFIG_FILE env variable

Fixes #10747

Signed-off-by: Andrey Abramov <st5pub@yandex.ru>
Andrey Abramov 6 years ago
parent
commit
6955331901
1 changed files with 5 additions and 0 deletions
  1. 5 0
      etcdmain/config.go

+ 5 - 0
etcdmain/config.go

@@ -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 {