From 34abead33e94d7187790a64c73e56eece3123764 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 85a037e83..78163aebe 100644 --- a/etcdctl/command/util.go +++ b/etcdctl/command/util.go @@ -348,8 +348,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 {