From 78afc853f44f8a12af214b597b25c49c898b0b93 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Mon, 17 Apr 2017 15:13:04 -0700 Subject: [PATCH] etcd-runner: update to use new lease interface --- .../etcd-runner/command/lease_renewer_command.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/functional-tester/etcd-runner/command/lease_renewer_command.go b/tools/functional-tester/etcd-runner/command/lease_renewer_command.go index e5257d430..070509747 100644 --- a/tools/functional-tester/etcd-runner/command/lease_renewer_command.go +++ b/tools/functional-tester/etcd-runner/command/lease_renewer_command.go @@ -50,7 +50,6 @@ func runLeaseRenewerFunc(cmd *cobra.Command, args []string) { for { var ( l *clientv3.LeaseGrantResponse - lk *clientv3.LeaseKeepAliveResponse err error ) for { @@ -62,13 +61,14 @@ func runLeaseRenewerFunc(cmd *cobra.Command, args []string) { expire := time.Now().Add(time.Duration(l.TTL-1) * time.Second) for { - lk, err = c.Lease.KeepAliveOnce(ctx, l.ID) + lk := c.Lease.KeepAliveOnce(ctx, l.ID) + err = lk.Err if grpc.Code(err) == codes.NotFound { if time.Since(expire) < 0 { log.Printf("bad renew! exceeded: %v", time.Since(expire)) for { - lk, err = c.Lease.KeepAliveOnce(ctx, l.ID) - fmt.Println(lk, err) + lk = c.Lease.KeepAliveOnce(ctx, l.ID) + fmt.Println(lk) time.Sleep(time.Second) } }