Skip to content

Commit a59a7ed

Browse files
committed
Add tests
1 parent bff51bc commit a59a7ed

File tree

2 files changed

+463
-0
lines changed

2 files changed

+463
-0
lines changed

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ func (server *Server) FailJob(ctx context.Context, failJob *proto.FailedJob) (*p
411411
if err != nil {
412412
return nil, xerrors.Errorf("get provisioner job: %w", err)
413413
}
414+
if job.WorkerID.UUID.String() != server.ID.String() {
415+
return nil, xerrors.New("you don't own this job")
416+
}
414417
if job.CompletedAt.Valid {
415418
return nil, xerrors.Errorf("job already completed")
416419
}

0 commit comments

Comments
 (0)