Skip to content

Commit 8d9157d

Browse files
authored
fix: use provisionerd context when failing job on canceled acquire (#11118)
Spotted during code read. We need to use the provisionerd auth context when failing a job due to a lost provisioner daemon.
1 parent 50575e1 commit 8d9157d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ func (s *server) AcquireJobWithCancel(stream proto.DRPCProvisionerDaemon_Acquire
274274
// in the database. We need to mark this job as failed so the end user can retry if they want to.
275275
now := dbtime.Now()
276276
err := s.Database.UpdateProvisionerJobWithCompleteByID(
277-
context.Background(),
277+
//nolint:gocritic // Provisionerd has specific authz rules.
278+
dbauthz.AsProvisionerd(context.Background()),
278279
database.UpdateProvisionerJobWithCompleteByIDParams{
279280
ID: je.job.ID,
280281
CompletedAt: sql.NullTime{

0 commit comments

Comments
 (0)