Merge pull request #727 from fanyangyang/monitoretcd

fix monitor etcd
This commit is contained in:
黄润豪 2020-04-10 11:46:14 +08:00 committed by GitHub
commit e81f7b0042
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)
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...)
}
}