Skip to content
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

Merged
merged 1 commit into from
May 16, 2017

Conversation

nikhita
Copy link
Member

@nikhita nikhita commented Apr 18, 2017

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 is nil 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 #44587

Special notes for your reviewer:

Release note:

Fix kube-apiserver crash when attempting an unsupported strategic merge patch operation on TPR data.

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
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 18, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

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 @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 18, 2017
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Apr 18, 2017
@xiang90
Copy link
Contributor

xiang90 commented Apr 18, 2017

@nikhita

can you add a simple test to ensure this wont happen in the future. thanks.

@nikhiljindal
Copy link
Contributor

@k8s-bot ok to test

cc @kubernetes/sig-api-machinery-pr-reviews

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 19, 2017
@nikhita
Copy link
Member Author

nikhita commented Apr 19, 2017

@k8s-bot non-cri e2e test this

@deads2k
Copy link
Contributor

deads2k commented Apr 21, 2017

@erictune are you and @foxish still planning on legacy TPR work? This is probably worth chasing up.

@foxish
Copy link
Contributor

foxish commented Apr 21, 2017

@deads2k, @enisoc will be taking over the TPR work I believe.

@nikhiljindal nikhiljindal assigned enisoc and unassigned dchen1107 and nikhiljindal May 2, 2017
@enisoc
Copy link
Member

enisoc commented May 15, 2017

@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

@sttts
Copy link
Contributor

sttts commented May 16, 2017

Any reason not to merge this? Even without a test, this has value and fixes a crash.

@sttts
Copy link
Contributor

sttts commented May 16, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 16, 2017
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 16, 2017
@sttts
Copy link
Contributor

sttts commented May 16, 2017

/approve

@k8s-github-robot
Copy link

[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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 2879b2c into kubernetes:master May 16, 2017
@k8s-github-robot
Copy link

@nikhita PR needs rebase

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2017
@philips
Copy link
Contributor

philips commented May 24, 2017

Can this be cherry-picked to v1.6.5?

@philips
Copy link
Contributor

philips commented May 24, 2017

@ericchiang put up a cherry-pick #46389

@enisoc enisoc added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels May 24, 2017
k8s-github-robot pushed a commit that referenced this pull request May 25, 2017
…4612-upstream-release-1.6

Automatic merge from submit-queue

Automated cherry pick of #44612

Cherry pick of #44612 on release-1.6.

#44612: Fix kube-apiserver crash when patching TPR data
@nikhita nikhita deleted the fix-patch-crash branch May 25, 2017 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube-apiserver crashes when trying to patch TPR data