feat: allow users to pause prebuilt workspace reconciliation (#18700)

This PR provides two commands:
* `coder prebuilds pause`
* `coder prebuilds resume`

These allow the suspension of all prebuilds activity, intended for use
if prebuilds are misbehaving.
This commit is contained in:
Sas Swart
2025-07-02 17:05:42 +02:00
committed by GitHub
parent 4072d228c5
commit 01163ea57b
42 changed files with 1336 additions and 4 deletions

View File

@ -474,6 +474,14 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
r.Get("/", api.userQuietHoursSchedule)
r.Put("/", api.putUserQuietHoursSchedule)
})
r.Route("/prebuilds", func(r chi.Router) {
r.Use(
apiKeyMiddleware,
api.RequireFeatureMW(codersdk.FeatureWorkspacePrebuilds),
)
r.Get("/settings", api.prebuildsSettings)
r.Put("/settings", api.putPrebuildsSettings)
})
// The /notifications base route is mounted by the AGPL router, so we can't group it here.
// Additionally, because we have a static route for /notifications/templates/system which conflicts
// with the below route, we need to register this route without any mounts or groups to make both work.