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

client-go: don't import client auth provider packages #41532

Merged
merged 2 commits into from
Feb 22, 2017

Conversation

ericchiang
Copy link
Contributor

@ericchiang ericchiang commented Feb 16, 2017

Both of these auth providers are useful for kubectl but not so much for everyone importing client-go. Let users optionally import them (example [0]) and reduce the overall number of imports that client-go requires.

Quick grep seems to imply it wont import it after.

$ grep -r 'client-go/plugin/pkg/client/auth' staging/
staging/src/k8s.io/client-go/plugin/pkg/client/auth/plugins.go:	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
staging/src/k8s.io/client-go/plugin/pkg/client/auth/plugins.go:	_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
staging/src/k8s.io/client-go/examples/third-party-resources/main.go:	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go:	_ "k8s.io/client-go/plugin/pkg/client/auth"
staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/internalclientset/clientset.go:	_ "k8s.io/client-go/plugin/pkg/client/auth"

closes kubernetes/client-go#49
updates kubernetes/client-go#79 (removes cloud.google.com/go import)

cc @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-auth-pr-reviews

client-go no longer imports GCP OAuth2 and OpenID Connect packages by default.

[0] https://github.com/kubernetes/client-go/blob/8b466d64c5da37e0d3985b907d812e1f58cb41cb/examples/third-party-resources/main.go#L34-L35

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 16, 2017
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 16, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@ericchiang
Copy link
Contributor Author

Removes 23 package dependencies (not projects) from k8s.io/client-go/kubernetes.

$ go list -f '{{.Deps}}' k8s.io/client-go/kubernetes | tr "[" " " | tr "]" " " | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'  | wc -l
168
$ git checkout kubectl-auth-providers 
Switched to branch 'kubectl-auth-providers'
$ go list -f '{{.Deps}}' k8s.io/client-go/kubernetes | tr "[" " " | tr "]" " " | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'  | wc -l
145

@sttts
Copy link
Contributor

sttts commented Feb 16, 2017

Proposed the same change before. Lgtm, but let somebody from sig-auth take a look.

@caesarxuchao
Copy link
Member

Partially adress kubernetes/client-go#95.

@caesarxuchao
Copy link
Member

Thanks @ericchiang.

@caesarxuchao
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 16, 2017
@@ -35,7 +35,6 @@ import (
v1alpha1rbac "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
v1beta1rbac "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
v1beta1storage "k8s.io/client-go/kubernetes/typed/storage/v1beta1"
_ "k8s.io/client-go/plugin/pkg/client/auth"
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is generated, compare

imports = append(imports, "_ \"k8s.io/client-go/plugin/pkg/client/auth\"")

Copy link
Contributor

Choose a reason for hiding this comment

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

I.e. please change the generator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Copy link
Member

Choose a reason for hiding this comment

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

Nice catch!

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 16, 2017
@caesarxuchao
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 17, 2017
@caesarxuchao
Copy link
Member

@lavalamp could you approve the change? Thanks.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2017
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 21, 2017
@ericchiang
Copy link
Contributor Author

rebased

@caesarxuchao caesarxuchao added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2017
@caesarxuchao
Copy link
Member

@lavalamp could you approve the change? Thanks.

@smarterclayton
Copy link
Contributor

smarterclayton commented Feb 21, 2017 via email

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

The following people have approved this PR: caesarxuchao, ericchiang, smarterclayton

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

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 21, 2017
@ericchiang
Copy link
Contributor Author

@k8s-bot cvm gce e2e test this

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 41349, 41532, 41256, 41587, 41657)

@k8s-github-robot k8s-github-robot merged commit c58266c into kubernetes:master Feb 22, 2017
@ericchiang ericchiang deleted the kubectl-auth-providers branch February 22, 2017 16:31
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 Denotes a PR that will be considered when it comes time to generate release notes. 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.

discovery: don't import client auth provider plugins
8 participants