Skip to content

Commit d505e4b

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. Close #2362 Signed-off-by: iiiceoo <[email protected]>
1 parent 30eae58 commit d505e4b

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)