diff --git a/internal/scheduler/gang_scheduler.go b/internal/scheduler/gang_scheduler.go index 5353a4e4aa2..e86e19eec4f 100644 --- a/internal/scheduler/gang_scheduler.go +++ b/internal/scheduler/gang_scheduler.go @@ -253,10 +253,7 @@ func (sch *GangScheduler) tryScheduleGangWithTxn(_ *armadacontext.Context, txn * func addNodeSelectorToGctx(gctx *schedulercontext.GangSchedulingContext, nodeSelectorKey, nodeSelectorValue string) { for _, jctx := range gctx.JobSchedulingContexts { - if jctx.PodRequirements.NodeSelector == nil { - jctx.PodRequirements.NodeSelector = make(map[string]string) - } - jctx.PodRequirements.NodeSelector[nodeSelectorKey] = nodeSelectorValue + jctx.AddNodeSelector(nodeSelectorKey, nodeSelectorValue) } } diff --git a/internal/scheduler/preempting_queue_scheduler.go b/internal/scheduler/preempting_queue_scheduler.go index 31345d79790..9457a215c17 100644 --- a/internal/scheduler/preempting_queue_scheduler.go +++ b/internal/scheduler/preempting_queue_scheduler.go @@ -862,8 +862,6 @@ func (evi *Evictor) Evict(ctx *armadacontext.Context, it nodedb.NodeIterator) (* // Create a scheduling context for when re-scheduling this job. // Mark as evicted and add a node selector to ensure the job is re-scheduled onto the node it was evicted from. jctx := schedulercontext.JobSchedulingContextFromJob(evi.priorityClasses, job, GangIdAndCardinalityFromAnnotations) - - // TODO: This is only necessary for jobs not scheduled in this cycle. jctx.IsEvicted = true jctx.AddNodeSelector(schedulerconfig.NodeIdLabel, node.Id) evictedJctxsByJobId[job.GetId()] = jctx diff --git a/internal/scheduler/testfixtures/testfixtures.go b/internal/scheduler/testfixtures/testfixtures.go index 8e14cf5cae9..e84ea325481 100644 --- a/internal/scheduler/testfixtures/testfixtures.go +++ b/internal/scheduler/testfixtures/testfixtures.go @@ -117,7 +117,6 @@ func TestSchedulingConfig() configuration.SchedulingConfig { ExecutorTimeout: 15 * time.Minute, MaxUnacknowledgedJobsPerExecutor: math.MaxInt, EnableNewPreemptionStrategy: true, - // AlwaysAttemptScheduling: true, } }