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

Let hardcoded auth options override AuthProvider in kubectl. #46666

Closed
wants to merge 1 commit into from

Conversation

cjcullen
Copy link
Member

What this PR does / why we need it:
If authorization options are hard-coded (either through config or command-line), let them override the AuthProvider config.
AuthProviders are usually specified in a kubeconfig file, but it is useful to be able to easily override things on the command line (e.g. kubectl --token ...).

Which issue this PR fixes: fixes #44476

Release note:

Explicit client authorization options (e.g. BearerToken, Username, KeyFile/KeyData) now override a specified AuthProvider.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 31, 2017
@cjcullen
Copy link
Member Author

cc @wanghaoran1988
Your work in #45817 is probably a better way to do this in general, but this fixes the immediate bug.

@cjcullen cjcullen added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 31, 2017
@wanghaoran1988
Copy link
Contributor

Not sure @ericchiang like this. I have another fix here:
xref: #45575

@ericchiang
Copy link
Contributor

This seems like a nice small fix for 1.7 since it's about other auth options instead of authorization headers. I'm for merging as is before code freeze.

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cjcullen
We suggest the following additional approver: krousey

Assign the PR to them by writing /assign @krousey in a comment when ready.

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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 31, 2017
@cjcullen
Copy link
Member Author

@wanghaoran1988 Oops, I hadn't seen your other PR.

I agree with @ericchiang and @deads2k that the current interface is too wide for how it it's actually being used, and we should fix it before somebody builds another plugin that does something more interesting. But I just want kubectl --token ... to work without having to go mess with my kubeconfig 😀.

@cjcullen
Copy link
Member Author

Closing this in favor of #45575.

@cjcullen cjcullen closed this May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl --token is not honored when ~/.kube/config has an authentication token
7 participants