From cb779b2305d1f6bb0433b756e2f9ba6b2d498a8d Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 30 Dec 2015 11:06:42 -0800 Subject: [PATCH] etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error --- etcdctl/command/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etcdctl/command/util.go b/etcdctl/command/util.go index 8eee91821..2337dfcb0 100644 --- a/etcdctl/command/util.go +++ b/etcdctl/command/util.go @@ -307,8 +307,8 @@ func syncWithPeerAPI(c *cli.Context, ctx context.Context, knownPeers []string) ( } body, err = ioutil.ReadAll(resp.Body) resp.Body.Close() - if err != nil { - continue + if err == nil { + break } } if err != nil {