-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add "tanzu context get-token" command to fetch a valid CSP token for the given context #502
Conversation
705b8d8
to
77c8f8b
Compare
Might be good to document the behavior when the tanzu cli is found but get-token is not, and when tanzu is not found.
Not to block this change, but we might want to take note to see if we can do some validation (by actually test running "tanzu context get-token" or something) before assigning the invocation to the kubeconfig's Exec |
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.
Nice! A question about interactive mode, and some thoughts about maybe doing some preflight check about the Exec command.
5592b3e
to
4f9014f
Compare
Created an Issue#506 to track and address it |
…the given context - Add a hidden command "tanzu context get-token" to fetch a valid CSP token for the given context. This command would be used in the kubeconfig generated for UCP resource to fetch/refresh the access-token dynamically. - Updated the kubeconfig generation logic to include the exec plugin to fetch the access token dynamically Signed-off-by: Prem Kumar Kalle <[email protected]>
4f9014f
to
6d3fbcb
Compare
What this PR does / why we need it
This PR adds "tanzu context get-token" command to fetch a valid CSP token for the given context
Changes Summary:
Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Created the UCP context and ran the tanzu context get-token and it successfully printed the ExecCredentials to stdout.
Tested with context that is not of UCP type
Created a UCP context and verified the kubeconfig has user information with ExecConfig with reference to
tanzu context get-token
Release note
Additional information
Special notes for your reviewer