Skip to content

Commit 190c4bc

Browse files
committed
fix fake
1 parent 315d869 commit 190c4bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

coderd/database/dbfake/dbfake.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ import (
2020
"golang.org/x/xerrors"
2121

2222
"github.com/coder/coder/coderd/database"
23+
"github.com/coder/coder/coderd/database/db2sdk"
2324
"github.com/coder/coder/coderd/httpapi"
2425
"github.com/coder/coder/coderd/rbac"
2526
"github.com/coder/coder/coderd/util/slice"
27+
"github.com/coder/coder/codersdk"
2628
)
2729

2830
var validProxyByHostnameRegex = regexp.MustCompile(`^[a-zA-Z0-9._-]+$`)
@@ -3424,6 +3426,15 @@ func (q *fakeQuerier) GetWorkspacesEligibleForTransition(ctx context.Context, no
34243426
workspaces = append(workspaces, workspace)
34253427
continue
34263428
}
3429+
3430+
job, err := q.getProvisionerJobByIDNoLock(ctx, build.JobID)
3431+
if err != nil {
3432+
return nil, xerrors.Errorf("get provisioner job by ID: %w", err)
3433+
}
3434+
if db2sdk.ProvisionerJobStatus(job) == codersdk.ProvisionerJobFailed {
3435+
workspaces = append(workspaces, workspace)
3436+
continue
3437+
}
34273438
}
34283439

34293440
return workspaces, nil

0 commit comments

Comments
 (0)