Skip to content

Commit 9c93dc1

Browse files
committed
🐛 fakeClient.Status().Update(...) cannot recognize resource version
conflicts The fake client of subresource is unable to correctly handle the case of resource version conflict when updating. The phenomenon is that it did not return a 409 status error. Signed-off-by: iiiceoo <[email protected]>
1 parent 30eae58 commit 9c93dc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/client/fake/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -992,11 +992,11 @@ func copyNonStatusFrom(old, new runtime.Object) error {
992992
}
993993
}
994994

995-
newClientObject.SetResourceVersion(rv)
996-
997995
if err := fromMapStringAny(newMapStringAny, new); err != nil {
998996
return fmt.Errorf("failed to convert back from map[string]any: %w", err)
999997
}
998+
newClientObject.SetResourceVersion(rv)
999+
10001000
return nil
10011001
}
10021002

0 commit comments

Comments
 (0)