-
Notifications
You must be signed in to change notification settings - Fork 224
Conversation
@dfuentes Is this a feature ya'll would like? |
@logikal Yeah, I think it could be useful. Let me take a look. |
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.
A few small things, but otherwise LGTM. Thanks!
Also, please update your branch from master :)
cmd/list.go
Outdated
RootCmd.AddCommand(listCmd) | ||
} | ||
|
||
func listPre(cmd *cobra.Command, args []string) { |
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.
Dead code?
cmd/list.go
Outdated
Properties: analytics.NewProperties(). | ||
Set("backend", backend). | ||
Set("aws-okta-version", version). | ||
Set("profile_count", len(profiles)). |
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 think this should be profile-count
, to standardize on dashes being the word separator. @systemizer may have opinions.
2314cc8
to
2bc4d7e
Compare
Thanks, @nickatsegment! I've fixed up the feedback and updated from master, squashed it all up, and think it's ready to go now. 🎅 |
Anything else needed here, @nickatsegment ? |
Sorry for the delay! |
cmd/list.go
Outdated
if role, exist := v["role_arn"]; exist { | ||
if src, exist := v["source_profile"]; exist { | ||
s := fmt.Sprintf("%s\t%s\t%s\t", profile, role, src) | ||
fmt.Fprintln(w, s) |
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.
Just use fmt.Fprintf
directly?
cmd/list.go
Outdated
fmt.Fprintln(w, "---\t---\t---\t") | ||
for profile, v := range profiles { | ||
if role, exist := v["role_arn"]; exist { | ||
if src, exist := v["source_profile"]; exist { |
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.
In the case where there is no source_profile
, no line gets printed. This is the case in my config, so I get no results from the whole command :( I wonder if you could use lib/config.go
's sourceProfile
function?
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.
Need to list profiles even when they don't have source_profile
.
I can never remember the names of the profiles I have configured, so this command will list them for you. Caveat: It assumes you only care about profiles that are assuming from another role. It only lists profiles with a source_profile.
2bc4d7e
to
a8e11be
Compare
Thanks, @nickatsegment! I fixed this to display profiles that don't have a source_profile, and also have it sort by |
🚢 |
I can never remember the names of the profiles I have configured, so this command will list them for you.
Caveat: It assumes you only care about profiles that are assuming from another role; it only lists profiles that have a source_profile.