aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

feat: Add Support for creating user entries with alias flag

Open elijah-roberts opened this issue 5 years ago • 16 comments
trafficstars

*Issue #, if available: Fixes #5164

*Description of changes: Added support for creating user name in kube-config with alias (simliar to the way context works with alias) Added appropriate testing for user name creation with and without alias flag

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

elijah-roberts avatar Apr 29 '20 00:04 elijah-roberts

@kyleknap @elysahall Anything else I can do for this PR?

elijah-roberts avatar Jun 11 '20 16:06 elijah-roberts

@elijah-roberts in your example from the issue, the context name is set to the same value as the user name. Is that missing from this PR?

nckturner avatar Oct 21 '20 19:10 nckturner

Nvm, I think I see how it works now, alias was already provided as a flag to set context name. While using alias for both username and context name would work, it seems like we could add a --user flag and not worry about breaking any users relying on the current behavior.

nckturner avatar Oct 21 '20 19:10 nckturner

Hi @elijah-roberts, can you address @nckturner's suggestions?

kdaily avatar Oct 22 '20 23:10 kdaily

Nvm, I think I see how it works now, alias was already provided as a flag to set context name. While using alias for both username and context name would work, it seems like we could add a --user flag and not worry about breaking any users relying on the current behavior.

That would work for me 👍 I can plan on implementing a flag and testing that out.

elijah-roberts avatar Oct 22 '20 23:10 elijah-roberts

Codecov Report

Merging #5165 into develop will decrease coverage by 1.45%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5165      +/-   ##
===========================================
- Coverage    93.97%   92.52%   -1.46%     
===========================================
  Files          188      196       +8     
  Lines        14548    15898    +1350     
===========================================
+ Hits         13672    14709    +1037     
- Misses         876     1189     +313     
Impacted Files Coverage Δ
awscli/customizations/eks/update_kubeconfig.py 97.93% <100.00%> (ø)
awscli/testutils.py 64.42% <0.00%> (-0.36%) :arrow_down:
awscli/help.py 96.48% <0.00%> (ø)
awscli/handlers.py 100.00% <0.00%> (ø)
awscli/customizations/commands.py 99.56% <0.00%> (ø)
awscli/customizations/s3/fileinfo.py 100.00% <0.00%> (ø)
awscli/customizations/emr/helptext.py 100.00% <0.00%> (ø)
awscli/customizations/emr/argumentschema.py 100.00% <0.00%> (ø)
awscli/customizations/emr/instancefleetsutils.py 100.00% <0.00%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2d07d7c...9968a77. Read the comment docs.

codecov-io avatar Oct 22 '20 23:10 codecov-io

@nckturner @kdaily I appreciate your reviewing my PR. I updated with the changes you suggested by breaking out this logic into a new flag user-alias. I have updated tests, and confirmed that it is working as expected for myself.

elijah-roberts avatar Oct 22 '20 23:10 elijah-roberts

@nckturner @kdaily Looks like the codecov/project failed despite the fact that I added testes for the code that I added. Is there something else that I need to do?

elijah-roberts avatar Oct 23 '20 15:10 elijah-roberts

@nckturner - let me know here if this is good to go!

@elijah-roberts - I'll look into the coverage failure.

Thanks both!

kdaily avatar Oct 23 '20 22:10 kdaily

Bump... @kdaily Any update on this?

elijah-roberts avatar Jan 05 '21 22:01 elijah-roberts

@kdaily this LGTM

nckturner avatar Jan 06 '21 04:01 nckturner

My team could really use this feature. @kdaily is this going to be merged?

Thanks!

potto007 avatar Mar 19 '21 23:03 potto007

+1 waiting for this to be merged. Any updates @kdaily?

joaoubaldo avatar Aug 05 '21 21:08 joaoubaldo

@joaoubaldo, @potto007, @elijah-roberts - this feature still needs review from the CLI team, and it is on the agenda for review. Marking it as such now. It's on the radar, but I don't know when it will be able to pull in.

kdaily avatar Aug 05 '21 22:08 kdaily

+1 - This feature would be a welcome addition

joshdk avatar Dec 23 '21 19:12 joshdk

Is there any chance it's merged? @kdaily We've faced an issue when the current behavior overrides existing users in the kube config file.

NOX73 avatar Sep 08 '22 15:09 NOX73

@joaoubaldo, @potto007, @kdaily bumping, @nckturner again, this is a simple non-breaking change that is useful for supporting the creation of multiple kube-configs for different roles. For enterprise EKS users typically there will be a daily role that has limited permissions, and mappings. There will also be a break-glass type admin role. Current state to support both of these you have to manually manage your kubeconfig file, or constantly overwrite the associated user each time you update the config with a different role.

Any chance we can get a review on this ? I am happy to make any necessary changes.

elijah-roberts avatar Dec 18 '22 21:12 elijah-roberts

Codecov Report

Merging #5165 (a575e2d) into develop (c05713e) will increase coverage by 0.00%. The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           develop   #5165   +/-   ##
=======================================
  Coverage     0.08%   0.08%           
=======================================
  Files          206     206           
  Lines        16488   16483    -5     
=======================================
  Hits            14      14           
+ Misses       16474   16469    -5     
Impacted Files Coverage Δ
awscli/customizations/eks/update_kubeconfig.py 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Dec 18 '22 21:12 codecov-commenter

Pulled in latest changes from develop, and the code coverage report looks good now

elijah-roberts avatar Dec 18 '22 22:12 elijah-roberts

Any chance to get this merged?

carlosjgp avatar Jan 25 '23 10:01 carlosjgp

We are trying to prioritize this feature request and get it merged soon. Note that this implements the same feature as #5413

yuxiang-zhang avatar Feb 14 '23 18:02 yuxiang-zhang

We are trying to prioritize this feature request and get it merged soon. Note that this implements the same feature as #5413

Thanks but that issue has also been open for the best part of 3 years. What's the holdup?

joshuamkite avatar Mar 15 '23 09:03 joshuamkite