Skip to content

FakeClient patch on any subresource other than status is not working #2503

@acumino

Description

@acumino

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

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions