Переглянути джерело

embed: Clear default initial cluster

NewConfig() should sets initial cluster from name but we should clear it
in the event that another discovery option has been specified.

Fixes #7516
Jonathan Sokolowski 8 роки тому
батько
коміт
1a91ed0e99
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      embed/config.go

+ 3 - 0
embed/config.go

@@ -246,6 +246,9 @@ func (cfg *configYAML) configFromFile(path string) error {
 		cfg.ACUrls = []url.URL(u)
 		cfg.ACUrls = []url.URL(u)
 	}
 	}
 
 
+	if (cfg.Durl != "" || cfg.DNSCluster != "") && cfg.InitialCluster == cfg.InitialClusterFromName(cfg.Name) {
+		cfg.InitialCluster = ""
+	}
 	if cfg.ClusterState == "" {
 	if cfg.ClusterState == "" {
 		cfg.ClusterState = ClusterStateFlagNew
 		cfg.ClusterState = ClusterStateFlagNew
 	}
 	}