From 1b9a76ed6d216460d8fedf73c8ce6d60f7a36e1c Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Fri, 10 Apr 2020 15:21:14 -0700 Subject: [PATCH] Fix #11321 Fix issues identified in https://github.com/etcd-io/etcd/issues/11321#issuecomment-612172439 --- embed/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embed/config.go b/embed/config.go index f13aee14e300..6393a8ab7041 100644 --- a/embed/config.go +++ b/embed/config.go @@ -37,6 +37,7 @@ import ( "go.etcd.io/etcd/pkg/types" bolt "go.etcd.io/bbolt" + "go.uber.org/multierr" "go.uber.org/zap" "go.uber.org/zap/zapcore" "golang.org/x/crypto/bcrypt" @@ -603,7 +604,7 @@ func (cfg *Config) PeerURLsMapAndToken(which string) (urlsmap types.URLsMap, tok case cfg.DNSCluster != "": clusterStrs, cerr := cfg.GetDNSClusterNames() lg := cfg.logger - if cerr != nil { + if len(clusterStrs) == 0 && cerr != nil { lg.Warn("failed to resolve during SRV discovery", zap.Error(cerr)) return nil, "", cerr } @@ -675,7 +676,7 @@ func (cfg *Config) GetDNSClusterNames() ([]string, error) { zap.Error(httpCerr), ) - return clusterStrs, cerr + return clusterStrs, multierr.Combine(cerr, httpCerr) } func (cfg Config) InitialClusterFromName(name string) (ret string) {