Skip to content

Commit 8cd6a6f

Browse files
committed
Prevent prebuild deletion from failing because old params were passed in
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 8849ad3 commit 8cd6a6f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

coderd/prebuilds/controller.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,13 @@ func (c Controller) provision(ctx context.Context, db database.Store, prebuildID
417417
Initiator(PrebuildOwnerUUID).
418418
ActiveVersion().
419419
VersionID(template.ActiveVersionID).
420-
MarkPrebuild().
421-
RichParameterValues(params)
420+
MarkPrebuild()
421+
422+
// We only inject the required params when the prebuild is being created.
423+
// This mirrors the behaviour of regular workspace deletion (see cli/delete.go).
424+
if transition != database.WorkspaceTransitionDelete {
425+
builder = builder.RichParameterValues(params)
426+
}
422427

423428
_, provisionerJob, _, err := builder.Build(
424429
ctx,

0 commit comments

Comments
 (0)