-
Notifications
You must be signed in to change notification settings - Fork 4.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
admission: enable webhooks by default #20744
admission: enable webhooks by default #20744
Conversation
/lgtm /hold hold for prereq pull. |
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.
Nitpicks, bu otherwise LGTM
"k8s.io/apimachinery/pkg/util/sets" | ||
"k8s.io/apiserver/pkg/admission" | ||
genericapiserver "k8s.io/apiserver/pkg/server" | ||
kubeapiserver "k8s.io/kubernetes/pkg/kubeapiserver/options" |
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.
Shouldn't vendored dependencies be called before openshift ones ?
At least that's what I see everywhere else
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.
fixed
|
||
// Admit enforces that pod and its project node label selectors matches at least a node in the cluster. | ||
func (p *podNodeEnvironment) Admit(a admission.Attributes) (err error) { | ||
func (p *podNodeEnvironment) admit(a admission.Attributes, mutationAllowed bool) (err error) { |
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.
The point of the boolean is to change behavior from mutation to validation only.
If you call the variable "validationOnly" then the code flow below can be changed from:
if mutationAllowed {
...
} else if (...) {
return xyz
}
...
to a more readable:
if validationOnly {
return xyz
}
... /* mutation and all */
At least I find this more readable and natural.
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.
We have this mutationAllowed style at a number of places. Would avoid to change that.
But I updated the code to follow your if-clause order, makes it easier, compare #20743.
76f1fcb
to
d4a4412
Compare
New changes are detected. LGTM label has been removed. |
d4a4412
to
94309b8
Compare
Pre-req is green. Rebasing. |
94309b8
to
9599d4c
Compare
9599d4c
to
a85355f
Compare
New changes are detected. LGTM label has been removed. |
Prereq is in. /hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
New changes are detected. LGTM label has been removed. |
a85355f
to
2d91150
Compare
@sttts: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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 understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/cherrypick release-3.11 |
@sttts: new pull request created: #20953 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. |
Follow-up of #20743.