Merge pull request #11225 from spzala/issue11210

pkg: handle version env variable
release-3.5
Jingyi Hu 2019-10-13 11:30:33 -07:00 committed by GitHub
commit a4e9d81df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -316,6 +316,13 @@ func (cfg *config) parse(arguments []string) error {
}
func (cfg *config) configFromCmdLine() error {
verKey := "ETCD_VERSION"
if verVal := os.Getenv(verKey); verVal != "" {
// unset to avoid any possible side-effect.
os.Unsetenv(verKey)
plog.Warningf("cannot set special environment variable %s=%s", verKey, verVal)
}
err := flags.SetFlagsFromEnv("ETCD", cfg.cf.flagSet)
if err != nil {
return err