Skip to content

Commit

Permalink
embed: Clear default initial cluster
Browse files Browse the repository at this point in the history
NewConfig() should sets initial cluster from name but we should clear it
in the event that another discovery option has been specified.

Fixes #7516
  • Loading branch information
jsok authored and gyuho committed Mar 18, 2017
1 parent 3221454 commit 72f37ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 72f37ff

Please sign in to comment.