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
This commit is contained in:
Jonathan Sokolowski 2017-03-16 13:46:44 +11:00 committed by Gyu-Ho Lee
parent 3221454cab
commit 72f37ff79a

View File

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