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

to validating the DELETE POD failed #41

Closed
Sn0rt opened this issue Sep 5, 2019 · 2 comments · Fixed by #64
Closed

to validating the DELETE POD failed #41

Sn0rt opened this issue Sep 5, 2019 · 2 comments · Fixed by #64
Assignees
Labels
bug Something isn't working

Comments

@Sn0rt
Copy link

Sn0rt commented Sep 5, 2019

hi, I want to delete pod safely.

so I set a validating web hook, I have to try the kubewebhook.

however, the framework can't check the delete operation. basecase of the delete does not have a body only have a request.

the code of deserializer doesn't take the request to the upper level.

	// Get the object.
	_, _, err := w.deserializer.Decode(ar.Request.Object.Raw, nil, runtimeObj)
	if err != nil {
		err = fmt.Errorf("error deseralizing request raw object: %s", err)
		return w.toAdmissionErrorResponse(ar, err)
	}
@Sn0rt
Copy link
Author

Sn0rt commented Sep 5, 2019

admissionRequest := kubecontext.GetAdmissionRequest(ctx)

@slok
Copy link
Owner

slok commented May 16, 2020

Reopening this because I'll close by linking the fix for the dynamic webhook issue (#63).

This is not needed anymore and the DELETE operations webhooks will come with the obj unmarshaled correctly, so there's no need to access the OldObject from the context AdmissionReview object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants