Repository navigation
fix(aws): only strip the value that follows --profile - #707
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
stripAndReturnProfileFlag dropped every later argument equal to the profile name, so 'aws --profile alice iam get-user --user-name alice' lost the trailing 'alice'. Skip just the value after --profile. Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
stripAndReturnProfileFlag(plugins/aws/cli_provisioner.go) removed every argument equal to the profile name, not only the value right after--profile. Soaws --profile alice iam get-user --user-name alicereached the AWS CLI asaws iam get-user --user-name, with the final value missing. The--profile=aliceform had the same problem.The fix skips just the one value that follows
--profileand leaves all other arguments as they are.Type of change
Related Issue(s)
None. No issue was filed for this.
How To Test
There are two new cases in
TestStripAndReturnProfileFlag, one for--profile aliceand one for--profile=alice, each followed by--user-name alice. Both fail without the change and pass with it. You can also runaws --profile <name> iam get-user --user-name <name>through the plugin: the trailing<name>should now be kept.Changelog
The AWS plugin no longer drops later command-line arguments that match the value passed to
--profile.This change was prepared with the assistance of an AI tool (Claude) and submitted by a human contributor who is responsible for it.