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

admission: enable webhooks by default #20744

Merged

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Aug 23, 2018

Follow-up of #20743.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 23, 2018
@bparees bparees removed their request for review August 23, 2018 14:58
@deads2k
Copy link
Contributor

deads2k commented Aug 28, 2018

/lgtm

/hold

hold for prereq pull.

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 28, 2018
Copy link
Contributor

@simo5 simo5 left a 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"
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@sttts sttts force-pushed the sttts-enable-admission-webhooks branch from 76f1fcb to d4a4412 Compare September 5, 2018 09:55
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2018
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@sttts
Copy link
Contributor Author

sttts commented Sep 6, 2018

Pre-req is green. Rebasing.

@sttts sttts force-pushed the sttts-enable-admission-webhooks branch from 94309b8 to 9599d4c Compare September 6, 2018 12:42
@sttts sttts added the lgtm Indicates that a PR is ready to be merged. label Sep 6, 2018
@sttts sttts force-pushed the sttts-enable-admission-webhooks branch from 9599d4c to a85355f Compare September 10, 2018 09:04
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2018
@sttts
Copy link
Contributor Author

sttts commented Sep 10, 2018

Prereq is in.

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 10, 2018
@openshift-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 10, 2018
@sttts sttts added the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2018
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@sttts sttts force-pushed the sttts-enable-admission-webhooks branch from a85355f to 2d91150 Compare September 10, 2018 10:37
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2018
@sttts sttts added the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2018
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 10, 2018

@sttts: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_builds 9599d4c link /test extended_builds

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 70c2506 into openshift:master Sep 10, 2018
@sttts
Copy link
Contributor Author

sttts commented Sep 12, 2018

/cherrypick release-3.11

@openshift-cherrypick-robot

@sttts: new pull request created: #20953

In response to this:

/cherrypick release-3.11

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants