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

Do not attempt to convert nil object during DELETE webhook admission #66425

Merged
merged 1 commit into from
Jul 20, 2018

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Jul 20, 2018

Fixes #66412

fixes a panic when using a mutating webhook admission plugin with a DELETE operation

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 20, 2018
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 20, 2018
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 20, 2018

// if a non-empty patch was provided, and we have no object we can apply it to (e.g. a DELETE admission operation), error
if attr.VersionedObject == nil {
return apierrors.NewInternalError(fmt.Errorf("admission webhook %q attempted to modify unset object", h.Name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "modify unset object" mean to a user?

Copy link
Member Author

@liggitt liggitt Jul 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarified message

@liggitt
Copy link
Member Author

liggitt commented Jul 20, 2018

/kind bug
/sig api-machinery
/priority critical-urgent
/milestone v1.11
/status approved-for-milestone

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. status/approved-for-milestone labels Jul 20, 2018
@k8s-ci-robot k8s-ci-robot added this to the v1.11 milestone Jul 20, 2018
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Jul 20, 2018
@liggitt
Copy link
Member Author

liggitt commented Jul 20, 2018

/retest

@sttts
Copy link
Contributor

sttts commented Jul 20, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 20, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, sttts

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

@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process

@liggitt @sttts

Pull Request Labels
  • sig/api-machinery: Pull Request will be escalated to these SIGs if needed.
  • priority/critical-urgent: Never automatically move pull request out of a release milestone; continually escalate to contributor and SIG through all available channels.
  • kind/bug: Fixes a bug discovered during the current release.
Help

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 0738778 into kubernetes:master Jul 20, 2018
@fedebongio
Copy link
Contributor

/cc @caesarxuchao

@caesarxuchao
Copy link
Member

lgtm

k8s-github-robot pushed a commit that referenced this pull request Jul 24, 2018
…5-upstream-release-1.11

Automatic merge from submit-queue.

Automated cherry pick of #66425: Do not attempt to convert nil object during DELETE webhook

Cherry pick of #66425 on release-1.11.

#66425: Do not attempt to convert nil object during DELETE webhook

```release-note
fixes a panic when using a mutating webhook admission plugin with a DELETE operation
```
@liggitt liggitt deleted the delete-admission-panic branch August 6, 2018 14:37
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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.

Mutating webhook for DELETE operations fail
6 participants