-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
FakeClient patch on any subresource other than status is not working.
For identifying if the last patch call was to update the status sub resource here we check if the stack trace has sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeSubResourceClient).Patch, and if true only allow to update status.
This is wrong as sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeSubResourceClient).Patch will be present in the stack trace if a patch is done on any subresource.
For ex, Patching scale subresource in deployment will also have sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeSubResourceClient).Patch in the stack trace because of which the code above will identify it as a status subresource update call and will not allow spec(replica) change in deployment.
Issues introduced with #2259
controller-runtime version - v0.16.2