-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubectl config set-crentials: add arguments for auth providers #30007
kubectl config set-crentials: add arguments for auth providers #30007
Conversation
Looks reasonable to me. Can we get some tests of that |
@@ -238,5 +269,14 @@ func (o createAuthInfoOptions) validate() error { | |||
} | |||
} | |||
|
|||
if len(o.authProviderArgs) > 0 { | |||
newPairs, removePairs, err := cmdutil.ParsePairs(o.authProviderArgs, "auth-provider-arg", true) |
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.
It's reasonable to do this Complete
so you never have to track o.authProviderArgs
and can have a non-mutating Validate
method. If you're unable to perform the Complete
step due to bad args, you can fail there.
The Validate
method allows for clean composition between commands, so that if you built a command on top of this one, you could have the kubectl fobber
command build a CreateAuthInfoOptions
, call Validate
(couldn't call Complete
since args are likely different), and then have a high confidence that Run
would work.
@fabianofranz something to watch for so get clean composition out of commands.
ed8d4e9
to
98c34e5
Compare
98c34e5
to
60c6ebe
Compare
This PR adds `--auth-provider` and `--auth-provider-arg` flags to the `kubectl config set-credentials` sub-command.
60c6ebe
to
974473c
Compare
Per @deads2k's comments, the flag parsing was moved to a different part of the code. Updated to add tests for various combinations of flags. |
LGTM. Thanks. |
GCE e2e build/test passed for commit 974473c. |
Automatic merge from submit-queue |
This PR adds
--auth-provider
and--auth-provider-arg
flags to thekubectl config set-credentials
sub-command.There's currently no way of interacting with the new auth provider framework added in #23066 through kubectl. You have to render a custom kubeconfig to use them. Additionally
kubectl config set
just sort of craps out when attempting to interact with authentication info objects (#29312).This is a minimal implementation of allowing
kubect config set-credentials
to set fields for client auth providers.cc @cjcullen @kubernetes/kubectl