mirror of https://github.com/coder/coder.git
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.
This commit is contained in:
parent
50575e1a9a
commit
8d9157dc35
|
@ -274,7 +274,8 @@ func (s *server) AcquireJobWithCancel(stream proto.DRPCProvisionerDaemon_Acquire
|
|||
// in the database. We need to mark this job as failed so the end user can retry if they want to.
|
||||
now := dbtime.Now()
|
||||
err := s.Database.UpdateProvisionerJobWithCompleteByID(
|
||||
context.Background(),
|
||||
//nolint:gocritic // Provisionerd has specific authz rules.
|
||||
dbauthz.AsProvisionerd(context.Background()),
|
||||
database.UpdateProvisionerJobWithCompleteByIDParams{
|
||||
ID: je.job.ID,
|
||||
CompletedAt: sql.NullTime{
|
||||
|
|
Loading…
Reference in New Issue