diff --git a/backend/remote-state/etcdv3/client.go b/backend/remote-state/etcdv3/client.go index fbc20d929..c6c82d7de 100644 --- a/backend/remote-state/etcdv3/client.go +++ b/backend/remote-state/etcdv3/client.go @@ -18,7 +18,6 @@ import ( const ( lockAcquireTimeout = 2 * time.Second lockInfoSuffix = ".lockinfo" - lockSuffix = ".lock" ) // RemoteClient is a remote client that will store data in etcd. @@ -165,7 +164,7 @@ func (c *RemoteClient) lock() (string, error) { ctx, cancel := context.WithTimeout(context.TODO(), lockAcquireTimeout) defer cancel() - mutex := etcdv3sync.NewMutex(session, c.Key+lockSuffix) + mutex := etcdv3sync.NewMutex(session, c.Key) if err1 := mutex.Lock(ctx); err1 != nil { lockInfo, err2 := c.getLockInfo() if err2 != nil { diff --git a/backend/remote-state/etcdv3/client_test.go b/backend/remote-state/etcdv3/client_test.go index d15a22c13..6fc330c3c 100644 --- a/backend/remote-state/etcdv3/client_test.go +++ b/backend/remote-state/etcdv3/client_test.go @@ -83,13 +83,11 @@ func TestEtcdv3_destroyLock(t *testing.T) { t.Fatal(err) } - lockPath := c.Key + lockSuffix - if err := c.Unlock(id); err != nil { t.Fatal(err) } - res, err := c.Client.KV.Get(context.TODO(), lockPath) + res, err := c.Client.KV.Get(context.TODO(), c.Key) if err != nil { t.Fatal(err) }