Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14009c9

Browse files
committed
set a failed canceled job status correctly
resolves #1374
1 parent 59b04c1 commit 14009c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

coderd/provisionerjobs.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,11 @@ func convertProvisionerJob(provisionerJob database.ProvisionerJob) codersdk.Prov
312312
switch {
313313
case provisionerJob.CanceledAt.Valid:
314314
if provisionerJob.CompletedAt.Valid {
315-
job.Status = codersdk.ProvisionerJobCanceled
315+
if job.Error == "" {
316+
job.Status = codersdk.ProvisionerJobCanceled
317+
} else {
318+
job.Status = codersdk.ProvisionerJobFailed
319+
}
316320
} else {
317321
job.Status = codersdk.ProvisionerJobCanceling
318322
}

0 commit comments

Comments
 (0)