Skip to content

Commit

Permalink
scheduler: set job on system stack for CSI feasibility check
Browse files Browse the repository at this point in the history
When the scheduler checks feasibility of each node, it creates a "stack" which
carries attributes of the job and task group it needs to check feasibility
for. The `system` and `sysbatch` scheduler use a different stack than `service`
and `batch` jobs. This stack was missing the call to set the job ID and
namespace for the CSI check. This prevents CSI volumes from being scheduled for
system jobs whenever the volume is in a non-default namespace.

Set the job ID and namespace to match the generic scheduler.
  • Loading branch information
tgross committed Nov 23, 2022
1 parent 2d52016 commit 405a0e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scheduler/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ func (s *SystemStack) SetJob(job *structs.Job) {
s.distinctPropertyConstraint.SetJob(job)
s.binPack.SetJob(job)
s.ctx.Eligibility().SetJob(job)
s.taskGroupCSIVolumes.SetNamespace(job.Namespace)
s.taskGroupCSIVolumes.SetJobID(job.ID)

if contextual, ok := s.quota.(ContextualIterator); ok {
contextual.SetJob(job)
Expand Down

0 comments on commit 405a0e1

Please sign in to comment.