diff --git a/pkg/storage/unified/apistore/store.go b/pkg/storage/unified/apistore/store.go index d4911da167c..11a5cc3e5ea 100644 --- a/pkg/storage/unified/apistore/store.go +++ b/pkg/storage/unified/apistore/store.go @@ -465,7 +465,7 @@ func (s *Storage) GuaranteedUpdate( return apierrors.NewNotFound(s.gr, req.Key.Name) } - updatedObj, _, err = tryUpdate(existingObj, res) + updatedObj, _, err = tryUpdate(existingObj.DeepCopyObject(), res) if err != nil { if attempt >= MaxUpdateAttempts { return err diff --git a/pkg/storage/unified/apistore/store_test.go b/pkg/storage/unified/apistore/store_test.go index 287aeea5c41..f0d648b9b5e 100644 --- a/pkg/storage/unified/apistore/store_test.go +++ b/pkg/storage/unified/apistore/store_test.go @@ -135,12 +135,12 @@ func TestDeleteWithSuggestion(t *testing.T) { storagetesting.RunTestDeleteWithSuggestion(ctx, t, store) } -//func TestDeleteWithSuggestionAndConflict(t *testing.T) { -// ctx, store, destroyFunc, err := testSetup(t) -// defer destroyFunc() -// assert.NoError(t, err) -// storagetesting.RunTestDeleteWithSuggestionAndConflict(ctx, t, store) -//} +func TestDeleteWithSuggestionAndConflict(t *testing.T) { + ctx, store, destroyFunc, err := testSetup(t) + defer destroyFunc() + assert.NoError(t, err) + storagetesting.RunTestDeleteWithSuggestionAndConflict(ctx, t, store) +} // TODO: this test relies on update //func TestDeleteWithSuggestionOfDeletedObject(t *testing.T) {