Skip to content

🐛 Fix Delete of PartialObjectMetadata for kinds not in the scheme - #3631

Open
DerekFrank wants to merge 1 commit into
kubernetes-sigs:mainfrom
DerekFrank:delete-metadata-unknown-kind
Open

DerekFrank wants to merge 1 commit into
kubernetes-sigs:mainfrom
DerekFrank:delete-metadata-unknown-kind

Conversation

@DerekFrank

@DerekFrank DerekFrank commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Since v0.25.0 the typed client decodes the delete response (controller-runtime#3472). For a PartialObjectMetadata of a kind that isn't in the client's scheme, that decode fails whenever the server returns the object, for example when finalizers hold it. The caller gets no kind "..." is registered even though the delete succeeded.

PartialObjectMetadata deletes now go through the unstructured client, which decodes any kind.

I only ran into this working on an update to Delete() that stores the response, I'm not actually sure if it can hit anyone in practice

Tests

A regression test in client_test.go deletes a ChaosPod held by a finalizer through a client whose scheme doesn't have ChaosPod. It fails without this change.

Release note: Fix Delete of PartialObjectMetadata for kinds not in the scheme returning an error after the object was deleted.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: DerekFrank
Once this PR has been reviewed and has the lgtm label, please assign alvaroaleman for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant