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

On DELETE operation reviews, unmarshal object from OldObject data instead of Object #64

Merged
merged 2 commits into from
May 16, 2020

Conversation

slok
Copy link
Owner

@slok slok commented May 16, 2020

When Kubernetes sends DELETE operations admission reviews, it assumes that the object will be deleted so, the review on Object data is empty. this caused two different ways of behavior depending on the type of the webhook:

  • Static: The received object by the webhook handler was empty.
  • Dynamic: The webhook processing failed with an unmarshal error.

Now when the received review is a DELETE operation, the data to unmarshal into the object will be obtained from OldObject data that comes with the review request.

slok added 2 commits May 16, 2020 12:35
…tead of Object

Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
@slok slok merged commit e8c88a9 into master May 16, 2020
@slok slok deleted the slok/delete-body branch May 16, 2020 11:04
@slok slok mentioned this pull request May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant