etcdmian: better error for srv discovery failure

release-2.2
Xiang Li 2015-08-06 11:38:53 -07:00
parent 01c286ccb6
commit 203e0f178b
1 changed files with 3 additions and 0 deletions

View File

@ -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)