Merge branch 'V5.2' into V5.2

This commit is contained in:
黄润豪 2020-04-10 16:54:27 +08:00 committed by GitHub
commit 472b6878bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,7 +184,7 @@ func (d *Monitor) discoverEtcd(e *callback.Etcd, done <-chan struct{}) {
endpoints := make([]*config.Endpoint, 0, 5) endpoints := make([]*config.Endpoint, 0, 5)
for _, member := range resp.Members { for _, member := range resp.Members {
if len(member.ClientURLs) > 1 { if len(member.ClientURLs) >= 1 {
url := member.ClientURLs[0] url := member.ClientURLs[0]
end := &config.Endpoint{ end := &config.Endpoint{
URL: url, URL: url,
@ -192,7 +192,7 @@ func (d *Monitor) discoverEtcd(e *callback.Etcd, done <-chan struct{}) {
endpoints = append(endpoints, end) endpoints = append(endpoints, end)
} }
} }
logrus.Debugf("etcd endpoints: %+v", endpoints)
e.UpdateEndpoints(endpoints...) e.UpdateEndpoints(endpoints...)
} }
} }