mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore!: allow CreateUser to accept multiple organizations (#14383)
* chore: allow CreateUser to accept multiple organizations In a multi-org deployment, it makes more sense to allow for multiple org memberships to be assigned at create. The legacy param will still be honored. * Handle sdk deprecation better by maintaining cli functions
This commit is contained in:
@@ -72,11 +72,11 @@ func (r *Runner) Run(ctx context.Context, id string, logs io.Writer) error {
|
||||
|
||||
_, _ = fmt.Fprintln(logs, "Creating user:")
|
||||
|
||||
user, err = r.client.CreateUser(ctx, codersdk.CreateUserRequest{
|
||||
OrganizationID: r.cfg.User.OrganizationID,
|
||||
Username: r.cfg.User.Username,
|
||||
Email: r.cfg.User.Email,
|
||||
Password: password,
|
||||
user, err = r.client.CreateUserWithOrgs(ctx, codersdk.CreateUserRequestWithOrgs{
|
||||
OrganizationIDs: []uuid.UUID{r.cfg.User.OrganizationID},
|
||||
Username: r.cfg.User.Username,
|
||||
Email: r.cfg.User.Email,
|
||||
Password: password,
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("create user: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user