Skip to content

chore: always use new codepath over deprecated #14050

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

Merged
merged 6 commits into from
Jul 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
linting
  • Loading branch information
Emyrk committed Jul 30, 2024
commit ca28cea922b01f6fdbcbeff90dc536229ca0c6b5
14 changes: 7 additions & 7 deletions coderd/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func createWorkspace(
// Do this upfront to save work. If this fails, the rest of the work
// would be wasted.
if !api.Authorize(r, policy.ActionCreate,
rbac.ResourceWorkspace.InOrg(template.OrganizationID).WithOwner(user.ID.String())) {
rbac.ResourceWorkspace.InOrg(template.OrganizationID).WithOwner(owner.ID.String())) {
httpapi.ResourceNotFound(rw)
return
}
Expand Down Expand Up @@ -588,7 +588,7 @@ func createWorkspace(
// read other workspaces. Ideally we check the error on create and look for
// a postgres conflict error.
workspace, err := api.Database.GetWorkspaceByOwnerIDAndName(ctx, database.GetWorkspaceByOwnerIDAndNameParams{
OwnerID: user.ID,
OwnerID: owner.ID,
Name: req.Name,
})
if err == nil {
Expand Down Expand Up @@ -621,7 +621,7 @@ func createWorkspace(
ID: uuid.New(),
CreatedAt: now,
UpdatedAt: now,
OwnerID: user.ID,
OwnerID: owner.ID,
OrganizationID: template.OrganizationID,
TemplateID: template.ID,
Name: req.Name,
Expand Down Expand Up @@ -689,8 +689,8 @@ func createWorkspace(
ProvisionerJob: *provisionerJob,
QueuePosition: 0,
},
user.Username,
user.AvatarURL,
owner.Username,
owner.AvatarURL,
[]database.WorkspaceResource{},
[]database.WorkspaceResourceMetadatum{},
[]database.WorkspaceAgent{},
Expand All @@ -712,8 +712,8 @@ func createWorkspace(
workspace,
apiBuild,
template,
user.Username,
user.AvatarURL,
owner.Username,
owner.AvatarURL,
api.Options.AllowWorkspaceRenames,
)
if err != nil {
Expand Down
Loading