-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support authentication helper for kubectl #9667
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb 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 |
cc @johngmyers |
pkg/kubeconfig/create_kubecfg.go
Outdated
"kubectl-auth", | ||
"--cluster=" + clusterName, | ||
"--state=" + kopsStateStore, | ||
"--api-version=" + "v1alpha1", |
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.
We might be able to default to v1beta1 now
pkg/commands/helpers/kubectl_auth.go
Outdated
cacheFilePath := cacheFilePath(f.KopsStateStore(), options.ClusterName) | ||
cached, err := loadCachedExecCredential(cacheFilePath) | ||
if err != nil { | ||
klog.Warningf("cached credential %q was not valid: %v", cacheFilePath, err) |
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.
Not sure this and the wrong API version count as warnings.
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.
I believe this is when the credential is an error, not just expired, but you're right - going with Infof
6f5f714
to
0eb3860
Compare
0eb3860
to
6b307a0
Compare
6b307a0
to
bd2aaa7
Compare
This seems to work, marking as no longer WIP. Thanks for the feedback @johngmyers and @rifelpet Also added a test! |
bd2aaa7
to
4827817
Compare
4827817
to
2b65dec
Compare
85897f6
to
d021004
Compare
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.
/lgtm
/hold to give opportunity to address review comment
d021004
to
f7c1685
Compare
We create a simple exec plugin command which can create and renew short-lived admin credentials on the fly, essentially leveraging the security of the underlying cloud credentials. Co-authored-by: John Gardiner Myers <[email protected]>
Also slightly simplify the tests and Kubecfg Builder signature by passing in the ConfigAccess only when needed.
f7c1685
to
8757a2c
Compare
/retest |
1 similar comment
/retest |
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
@justinsb: The following test failed, say
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. |
/retest |
We create a simple exec plugin command which can create and renew
short-lived admin credentials on the fly, essentially leveraging the
security of the underlying cloud credentials.