From b163b78d45d93b93b9120ca22caba5f028ac3f64 Mon Sep 17 00:00:00 2001 From: mac <mac@macdeMacBook-Pro.local> Date: Thu, 29 Oct 2020 14:33:34 +0800 Subject: [PATCH] =?UTF-8?q?ectd=E6=B3=A8=E5=86=8C=E4=B8=AD=E5=BF=83BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- registry/etcdv3/registry.go | 2 +- registry/etcdv3/service_discovery.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/registry/etcdv3/registry.go b/registry/etcdv3/registry.go index 9cbc49456..f3cc379bd 100644 --- a/registry/etcdv3/registry.go +++ b/registry/etcdv3/registry.go @@ -91,7 +91,7 @@ func newETCDV3Registry(url *common.URL) (registry.Registry, error) { r, etcdv3.WithName(etcdv3.RegistryETCDV3Client), etcdv3.WithTimeout(timeout), - etcdv3.WithEndpoints(url.Location), + etcdv3.WithEndpoints(strings.Split(url.Location, ",")...), ); err != nil { return nil, err } diff --git a/registry/etcdv3/service_discovery.go b/registry/etcdv3/service_discovery.go index dceaa99df..e8d4aea9a 100644 --- a/registry/etcdv3/service_discovery.go +++ b/registry/etcdv3/service_discovery.go @@ -19,6 +19,7 @@ package etcdv3 import ( "fmt" + "strings" "sync" "time" ) @@ -313,7 +314,7 @@ func newEtcdV3ServiceDiscovery(name string) (registry.ServiceDiscovery, error) { client := etcdv3.NewServiceDiscoveryClient( etcdv3.WithName(etcdv3.RegistryETCDV3Client), etcdv3.WithTimeout(timeout), - etcdv3.WithEndpoints(remoteConfig.Address), + etcdv3.WithEndpoints(strings.Split(remoteConfig.Address, ",")...), ) descriptor := fmt.Sprintf("etcd-service-discovery[%s]", remoteConfig.Address) -- GitLab