-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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 kube-apiserver crash when patching TPR data #44612
Conversation
While trying to do a strategic merge patch, kube-apiserver crashes with a nil pointer dereference because UnsafeConvertor is nil for TPR data resources. Fixes kubernetes#44587
Hi @nikhita. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with 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. I understand the commands that are listed here. |
can you add a simple test to ensure this wont happen in the future. thanks. |
@k8s-bot ok to test cc @kubernetes/sig-api-machinery-pr-reviews |
@k8s-bot non-cri e2e test this |
@nikhita Do you have time to add a test for this? If so, I think it could go here: https://github.com/kubernetes/kubernetes/blob/master/test/integration/thirdparty/thirdparty_test.go |
Any reason not to merge this? Even without a test, this has value and fixes a crash. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nikhita, sttts
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue |
@nikhita PR needs rebase |
Can this be cherry-picked to v1.6.5? |
@ericchiang put up a cherry-pick #46389 |
What this PR does / why we need it: While trying to do a strategic merge patch, kube-apiserver crashes with a nil pointer dereference because
UnsafeConvertor
isnil
for TPR data resources here: https://github.com/kubernetes/kubernetes/blob/master/pkg/master/thirdparty/thirdparty.go#L314-L337.This PR does not make strategic merge patch work on TPR data but makes sure that the kube-api server does not crash while trying to do so.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #44587Special notes for your reviewer:
Release note: