From 203e0f178b0f89df1ceacdc9f0b8b98a88c0fbd6 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Thu, 6 Aug 2015 11:38:53 -0700 Subject: [PATCH] etcdmian: better error for srv discovery failure --- etcdmain/etcd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index 7ed33167c..a9017d122 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -403,6 +403,9 @@ func getPeerURLsMapAndToken(cfg *config) (urlsmap types.URLsMap, token string, e return nil, "", err } urlsmap, err = types.NewURLsMap(clusterStr) + if _, ok := urlsmap[cfg.name]; !ok { + return nil, "", fmt.Errorf("cannot find local etcd member %q in SRV records", cfg.name) + } default: // We're statically configured, and cluster has appropriately been set. urlsmap, err = types.NewURLsMap(cfg.initialCluster)