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 plugin initializer for the generic API server. #43710

Conversation

p0lyn0mial
Copy link
Contributor

What this PR does / why we need it:
This PR implements a standard admission plugin initializer for the generic API server.
The initializer uses kubeconfig to populate external clients and informers. By default
in-cluster config is used.

Special notes for your reviewer:
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/apiserver-build-in-admission-plugins.md

Release note: NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 27, 2017
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Mar 27, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @p0lyn0mial. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

@p0lyn0mial
Copy link
Contributor Author

@deads2k please take a look.

@deads2k deads2k self-assigned this Mar 27, 2017
}
}

extClientset, err := kubernetes.NewForConfig(cfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accept the clientset and informer factory as arguments.

The informer factory should be shared. We only want a single instance or we'll end up with multiple list/watches running.

The clientset will be privileged and settings like QPS and roundtrippers should be configured externally and passed here.

I like the idea of including a loopback *rest.Config through the initializer so that people aren't forced to create their own initializers if they don't want to.

@deads2k
Copy link
Contributor

deads2k commented Mar 27, 2017

Just the comment about the New method. lgtm otherwise

@deads2k
Copy link
Contributor

deads2k commented Mar 27, 2017

@k8s-bot ok to test

@deads2k
Copy link
Contributor

deads2k commented Mar 27, 2017

hack/update-bazel.sh

@deads2k
Copy link
Contributor

deads2k commented Mar 27, 2017

might have to add your package to the list of linted packages too

@p0lyn0mial p0lyn0mial force-pushed the implement_standard_admission_plugin_initializer branch from 09b0714 to 4546b69 Compare March 27, 2017 20:29
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 27, 2017
@p0lyn0mial
Copy link
Contributor Author

New method updated

This PR implements a standard admission plugin initializer for the generic API server.
The initializer accepts external clientset, external informers and the authorizer.
@p0lyn0mial p0lyn0mial force-pushed the implement_standard_admission_plugin_initializer branch from 4546b69 to 86e06e2 Compare March 28, 2017 07:29
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 28, 2017
@deads2k
Copy link
Contributor

deads2k commented Mar 28, 2017

@k8s-bot gci gce e2e test this

@deads2k
Copy link
Contributor

deads2k commented Mar 28, 2017

/lgtm
/release-note-none
/approve

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed release-note-label-needed labels Mar 28, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deads2k, p0lyn0mial
We suggest the following additional approver: @thockin

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@deads2k
Copy link
Contributor

deads2k commented Mar 28, 2017

This looks like a good starting point.

@deads2k deads2k added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2017
@deads2k
Copy link
Contributor

deads2k commented Mar 28, 2017

vendor/BUILD strikes again. approved.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 41541, 43710)

@k8s-github-robot k8s-github-robot merged commit f657607 into kubernetes:master Mar 28, 2017
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants