-
Notifications
You must be signed in to change notification settings - Fork 114
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
[AUTOMATE-2866] Remove v1 users APIs from gateway #2922
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -994,23 +994,23 @@ func runCreateIAMDevUsersCmd(*cobra.Command, []string) error { | |
return err | ||
} | ||
for username, data := range map[string]struct { | ||
displayName, password, team string | ||
displayName, password, teamID string | ||
}{ | ||
"viewer": {"Viewer User", "chefautomate", "viewers"}, | ||
"editor": {"Editor User", "chefautomate", "editors"}, | ||
} { | ||
userID, _, err := adminmgmt.CreateUserOrUpdatePassword(ctx, | ||
apiClient, username, data.displayName, data.password, false /* dry run */) | ||
apiClient, username, data.displayName, data.password, false) | ||
if err != nil { | ||
return err | ||
} | ||
// Note: the teams SHOULD exist. But since you never know what happens in a | ||
// long running acceptance env, we'll better ensure them: | ||
teamID, _, err := adminmgmt.EnsureTeam(ctx, data.team, data.team /* description */, apiClient, false /* dry run */) | ||
_, err = adminmgmt.EnsureTeam(ctx, data.teamID, data.teamID, apiClient, false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we still need to ensure these teams? How is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least one integration test. I didn't look into it too heavily besides just not breaking it:
|
||
if err != nil { | ||
return err | ||
} | ||
_, err = adminmgmt.AddUserToTeam(ctx, apiClient, teamID, userID, false /* dry run */) | ||
_, err = adminmgmt.AddUserToTeam(ctx, apiClient, data.teamID, userID, false) | ||
if err != nil { | ||
return err | ||
} | ||
|
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.
do we still need the
dry run
parameter? if we do let's keep the comment so we remember what that bool is for π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 disagree that this comment is useful. The function signature says what the boolean is doing. We don't have similar comments everywhere else we pass a boolean.