diff --git a/pkg/etcd/etcd.go b/pkg/etcd/etcd.go index ff2d98b752..f9f484553d 100644 --- a/pkg/etcd/etcd.go +++ b/pkg/etcd/etcd.go @@ -750,8 +750,12 @@ members: if member.IsLearner { continue } - for _, url := range member.ClientURLs { - if strings.Contains(url, ip) { + for _, clientURL := range member.ClientURLs { + u, err := url.Parse(clientURL) + if err != nil { + continue + } + if u.Hostname() == ip { continue members } }