-
Notifications
You must be signed in to change notification settings - Fork 423
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
Adding session name parameter to TokenGenerator #272
Adding session name parameter to TokenGenerator #272
Conversation
Welcome @SaranBalaji90! |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. |
@@ -279,6 +280,10 @@ func (g generator) GetWithOptions(options *GetTokenOptions) (Token, error) { | |||
}) | |||
} | |||
|
|||
} else if options.SessionName != "" { |
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.
Nit: remove the empty line above.
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.
Can you also include an update in the README with your new flag?
Also, can you include a test in /pkg/token/token_test.go
?
cache := viper.GetBool("cache") | ||
|
||
if clusterID == "" { | ||
fmt.Fprintf(os.Stderr, "Error: cluster ID not specified\n") | ||
cmd.Usage() | ||
os.Exit(1) | ||
} | ||
if forwardSessionName && sessionName != "" { |
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.
Please leave one blank line between the if blocks. Also please fix the indentation for cmd.Usage and os.Exit calls.
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: micahhausler, SaranBalaji90 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 |
Added output for generated kubeconfig filename
Adding sessionName parameter to authenticator client. Clients can set different session name when using roles to authenticate to API Server.
Changes include,
cmd/../token.go ->
i) Adding new parameter to read the session name.
ii) Added validation to say either forwardSessionName or sessionName can be used when using role but not both.
pkg/.../token.go ->
i) Added SessionName to GetTokenOptions struct
ii) Setting session name when creating session object through role.
cr https://code.amazon.com/reviews/CR-14787523