-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Delete validation for Validator interface is broken on k8s versions < 1.15 #845
Comments
/help |
@vincepri: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
controller-runtime/pkg/webhook/admission/validator.go Lines 94 to 96 in fc39662
kubernetes/kubernetes#76346 this PR only started to be avavilable in 1.15+. In <=1.14, the old object is not passed in the admission request body for delete operation. I guess the fix is to check if req.OldObject is empty in the Delete operation. If empty, just skip it.
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@mrparkers Are you working on this issue? If not, I will submit a PR to fix this 🍻 . |
@YangKeao this isn't something I'm worried about anymore since AWS EKS supports 1.15+ where this issue is not present. Feel free to take this on if you'd like 👍 |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
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'm having this issue on /reopen |
@felipeweb: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
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. |
Hi, I'm using controller-runtime@v0.4.0 on a local Kubernetes cluster (v1.14.7). I'm running into an issue with implementing the Validator interface for a ValidatingAdmissionWebhook.
After implementing this interface, create/update works just fine, but delete always fails with this error message:
It looks like the code that consumes the Validator interface assumes that
req.OldObject
exists:controller-runtime/pkg/webhook/admission/validator.go
Line 96 in d0de78d
The Kubernetes PR that is referenced in the comments (kubernetes/kubernetes#76346) adds this field to the request that the API server sends to the webhook. This PR landed in 1.15, which is an issue for users that run local Kubernetes via Docker for Mac, which currently uses 1.14 in the stable channel, or Amazon EKS customers, which does not yet support 1.15.
If you'd like, I'd be willing to attempt a PR to fix this problem.
Thanks!
The text was updated successfully, but these errors were encountered: