From 1a91ed0e99c425e6f5b1963297c3e83fb9d178b4 Mon Sep 17 00:00:00 2001 From: Jonathan Sokolowski Date: Thu, 16 Mar 2017 13:46:44 +1100 Subject: [PATCH] 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 --- embed/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/embed/config.go b/embed/config.go index 7d0f1bf01..56fd3f35c 100644 --- a/embed/config.go +++ b/embed/config.go @@ -246,6 +246,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 }