-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 broken AdmissionReview #3574
Fix broken AdmissionReview #3574
Conversation
@@ -256,6 +258,9 @@ func (a *Admission) serve(w http.ResponseWriter, r *http.Request, admit admitFun | |||
|
|||
responseAdmissionReview.Response.UID = requestedAdmissionReview.Request.UID | |||
|
|||
responseAdmissionReview.APIVersion = requestedAdmissionReview.APIVersion | |||
responseAdmissionReview.Kind = requestedAdmissionReview.Kind | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the second function "serve" is actually used. It may be dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
$ golangci-lint run --disable-all -E unused ./pkg/admission/.
pkg/admission/admission.go:224:21: func `(*Admission).serve` is unused (unused)
I've filed #3576 as a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Not sure why the e2e tests didn't catch it. Is it related to the Kubernetes version?
@@ -256,6 +258,9 @@ func (a *Admission) serve(w http.ResponseWriter, r *http.Request, admit admitFun | |||
|
|||
responseAdmissionReview.Response.UID = requestedAdmissionReview.Request.UID | |||
|
|||
responseAdmissionReview.APIVersion = requestedAdmissionReview.APIVersion | |||
responseAdmissionReview.Kind = requestedAdmissionReview.Kind | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
$ golangci-lint run --disable-all -E unused ./pkg/admission/.
pkg/admission/admission.go:224:21: func `(*Admission).serve` is unused (unused)
I've filed #3576 as a follow-up.
Thanks for the PR, do you mind just editing the title to explain what you fix, this makes it much easier when writing a CHANGELOG :) Thanks! |
LGTM and thank you so much for the contribution! |
I'm testing locally with Kube v1.17.11 as it was originally reported in #3473. |
Ok, I know why we didn't reproduce it in the CI. We still use and document @brancz should we switch to |
v1 only, and we fix the docs and just add it to the CHANGES in the CHANGELOG, if code assumes that makes no sense to test against both. |
Thanks! |
The webhooks were failing as they aren't returning an apiVersion or kind in the response.
Closes #3473