From a0b13873eb0f743e005f2feabc62e3dec0b0a01d Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Mon, 11 Dec 2023 08:49:37 +0400 Subject: [PATCH] fix: use provisionerd context when failing job on canceled acquire --- coderd/provisionerdserver/provisionerdserver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 250308bf93489..91d0ec6d50928 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -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{