New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DeleteCollection API decode DeleteOptions fail #113133
Conversation
@sxllwx: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
Thanks! |
@@ -214,13 +215,14 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope *RequestSc | |||
|
|||
options := &metav1.DeleteOptions{} | |||
if checkBody { | |||
body, err := limitedReadBody(req, scope.MaxRequestBodyBytes) | |||
body, err := limitedReadBodyWithRecordMetric(ctx, req, scope.MaxRequestBodyBytes, scope.Resource.GroupResource().String(), requestmetrics.Delete) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DELETECOLLECTION is its own verb and probably should not use requestmetrics.Delete here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in latest commit, PTAL~
@apelisse the test failure here appears to be in SSA integration tests, is that flaky? I wouldn't expect this code change to break that. |
There seems to be a little bit of flakiness around these tests, we should definitely take a look: |
the test logs sound like it's trying to apply something to widgets before widgets have been created... |
/triage accepted |
The reason for the issue is that the apiserver uses the Scheme in the global variable pkg/api/legacyscheme/scheme.go, and registers the DeleteOptions corresponding to each APIGroup in the Scheme. But DeleteOptions in meta.k8s.io/v1 is not registered, resulting in a notRegisteredErr. Use metainternalversionscheme.Codecs as Serializer
cd4d2ee
to
e7d7f4a
Compare
I've posted my understanding of the flake somewhere else, and we probably should have the discussion there, it's totally unrelated to this PR. |
/ping @lavalamp PTAL, thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
(I edited a release note into the OP to avoid having to do another review round, double check to see if you agree with it) /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lavalamp, sxllwx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The do not merge release note tag seems to still be there. /release-note-edit |
@lavalamp You might need to manually remove the "do-not-merge/release-note-label-needed" label as well. |
/release-note-edit |
Manually removed since it seems correct AFAICT and the bot doesn't like my commands |
…k-of-kubernetes#113133-upstream-release-1.25 Automated cherry pick of kubernetes#113133: Fix DeleteCollection API decode DeleteOptions fail
…33-upstream-release-1.25 Automated cherry pick of #113133: Fix DeleteCollection API decode DeleteOptions fail
…k-of-kubernetes#113133-upstream-release-1.25 Automated cherry pick of kubernetes#113133: Fix DeleteCollection API decode DeleteOptions fail
…k-of-kubernetes#113133-upstream-release-1.25 Automated cherry pick of kubernetes#113133: Fix DeleteCollection API decode DeleteOptions fail
What type of PR is this?
/kind bug
What this PR does / why we need it:
DeleteCollection API decode DeleteOptions fail.
The reason for the issue is that the apiserver uses the Scheme in the global variable pkg/api/legacyscheme/scheme.go, and registers the DeleteOptions corresponding to each APIGroup in the Scheme. But DeleteOptions in meta.k8s.io/v1 is not registered, resulting in a notRegisteredErr.
Which issue(s) this PR fixes:
Fixes # #111985
Special notes for your reviewer:
Maybe we need to cherry-pick to the most recent release.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: