Skip to content

fix: Allow to stop or remove workspaces using rich and old parameters #6099

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 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
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
Fix
  • Loading branch information
mtojek committed Feb 8, 2023
commit 9a35d09be4b183c0acdcc59fdf8d5b3b2534e1e7
2 changes: 1 addition & 1 deletion coderd/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
return
}

if (createBuild.Transition == codersdk.WorkspaceTransitionStart || createBuild.Transition == codersdk.WorkspaceTransitionCreate) &&
if createBuild.Transition == codersdk.WorkspaceTransitionStart &&
len(legacyParameters) > 0 && len(parameters) > 0 {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Rich parameters can't be used together with legacy parameters.",
Expand Down
1 change: 0 additions & 1 deletion codersdk/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
type WorkspaceTransition string

const (
WorkspaceTransitionCreate WorkspaceTransition = "create"
WorkspaceTransitionStart WorkspaceTransition = "start"
WorkspaceTransitionStop WorkspaceTransition = "stop"
WorkspaceTransitionDelete WorkspaceTransition = "delete"
Expand Down