diff --git a/pkg/client/testing/core/fake.go b/pkg/client/testing/core/fake.go index 8e54f4b62b9..751780b1d6a 100644 --- a/pkg/client/testing/core/fake.go +++ b/pkg/client/testing/core/fake.go @@ -179,7 +179,7 @@ func (c *Fake) InvokesProxy(action Action) restclient.ResponseWrapper { // ClearActions clears the history of actions called on the fake client func (c *Fake) ClearActions() { c.Lock() - c.Unlock() + defer c.Unlock() c.actions = make([]Action, 0) }