From 62ce3a196e095262f154ee7823e950802be0453b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E7=BE=8A=E7=BE=8A?= Date: Fri, 10 Apr 2020 11:18:09 +0800 Subject: [PATCH] fix monitor etcd --- monitor/monitor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor/monitor.go b/monitor/monitor.go index 69759605f..678bd89f7 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -184,7 +184,7 @@ func (d *Monitor) discoverEtcd(e *callback.Etcd, done <-chan struct{}) { endpoints := make([]*config.Endpoint, 0, 5) for _, member := range resp.Members { - if len(member.ClientURLs) > 1 { + if len(member.ClientURLs) >= 1 { url := member.ClientURLs[0] end := &config.Endpoint{ URL: url, @@ -192,7 +192,7 @@ func (d *Monitor) discoverEtcd(e *callback.Etcd, done <-chan struct{}) { endpoints = append(endpoints, end) } } - + logrus.Debugf("etcd endpoints: %+v", endpoints) e.UpdateEndpoints(endpoints...) } }