Skip to content

Commit 04a481d

Browse files
committed
refactor: remove lifecycle API endpoint changes
1 parent 85d24ab commit 04a481d

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

coderd/workspaces.go

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,17 +1090,6 @@ func (api *API) putWorkspaceAutostart(rw http.ResponseWriter, r *http.Request) {
10901090
return
10911091
}
10921092

1093-
// Autostart configuration is not supported for prebuilt workspaces.
1094-
// Prebuild lifecycle is managed by the reconciliation loop, with scheduling behavior
1095-
// defined per preset at the template level, not per workspace.
1096-
if workspace.IsPrebuild() {
1097-
httpapi.Write(ctx, rw, http.StatusUnprocessableEntity, codersdk.Response{
1098-
Message: "Autostart is not supported for prebuilt workspaces",
1099-
Detail: "Prebuilt workspace scheduling is configured per preset at the template level. Workspace-level overrides are not supported.",
1100-
})
1101-
return
1102-
}
1103-
11041093
dbSched, err := validWorkspaceSchedule(req.Schedule)
11051094
if err != nil {
11061095
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
@@ -1185,17 +1174,6 @@ func (api *API) putWorkspaceTTL(rw http.ResponseWriter, r *http.Request) {
11851174
return
11861175
}
11871176

1188-
// TTL updates are not supported for prebuilt workspaces.
1189-
// Prebuild lifecycle is managed by the reconciliation loop, with TTL behavior
1190-
// defined per preset at the template level, not per workspace.
1191-
if workspace.IsPrebuild() {
1192-
httpapi.Write(ctx, rw, http.StatusUnprocessableEntity, codersdk.Response{
1193-
Message: "TTL updates are not supported for prebuilt workspaces",
1194-
Detail: "Prebuilt workspace TTL is configured per preset at the template level. Workspace-level overrides are not supported.",
1195-
})
1196-
return
1197-
}
1198-
11991177
var dbTTL sql.NullInt64
12001178

12011179
err := api.Database.InTx(func(s database.Store) error {
@@ -1312,16 +1290,6 @@ func (api *API) putWorkspaceDormant(rw http.ResponseWriter, r *http.Request) {
13121290
return
13131291
}
13141292

1315-
// Dormancy configuration is not supported for prebuilt workspaces.
1316-
// Prebuilds are managed by the reconciliation loop and are not subject to dormancy.
1317-
if oldWorkspace.IsPrebuild() {
1318-
httpapi.Write(ctx, rw, http.StatusUnprocessableEntity, codersdk.Response{
1319-
Message: "Dormancy configuration is not supported for prebuilt workspaces",
1320-
Detail: "Prebuilt workspaces are not subject to dormancy. Dormancy behavior is only applicable to regular workspaces",
1321-
})
1322-
return
1323-
}
1324-
13251293
// If the workspace is already in the desired state do nothing!
13261294
if oldWorkspace.DormantAt.Valid == req.Dormant {
13271295
rw.WriteHeader(http.StatusNotModified)
@@ -1466,17 +1434,6 @@ func (api *API) putExtendWorkspace(rw http.ResponseWriter, r *http.Request) {
14661434
return
14671435
}
14681436

1469-
// Deadline extensions are not supported for prebuilt workspaces.
1470-
// Prebuilds are managed by the reconciliation loop and must always have
1471-
// Deadline and MaxDeadline unset.
1472-
if workspace.IsPrebuild() {
1473-
httpapi.Write(ctx, rw, http.StatusUnprocessableEntity, codersdk.Response{
1474-
Message: "Deadline extension is not supported for prebuilt workspaces",
1475-
Detail: "Prebuilt workspaces do not support user deadline modifications. Deadline extension is only applicable to regular workspaces",
1476-
})
1477-
return
1478-
}
1479-
14801437
code := http.StatusOK
14811438
resp := codersdk.Response{}
14821439

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy