From 82a54e8cc8244ffb2111330b2b690bb4dc6a6a84 Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Sun, 21 Jul 2024 16:04:25 +0900 Subject: [PATCH] cleanup: remove duplicated addNominatedPodUnlocked --- pkg/scheduler/internal/queue/scheduling_queue.go | 2 -- .../internal/queue/scheduling_queue_test.go | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/pkg/scheduler/internal/queue/scheduling_queue.go b/pkg/scheduler/internal/queue/scheduling_queue.go index a54967626ee..d2776cbcc01 100644 --- a/pkg/scheduler/internal/queue/scheduling_queue.go +++ b/pkg/scheduler/internal/queue/scheduling_queue.go @@ -810,7 +810,6 @@ func (p *PriorityQueue) addUnschedulableWithoutQueueingHint(logger klog.Logger, metrics.SchedulerQueueIncomingPods.WithLabelValues("unschedulable", ScheduleAttemptFailure).Inc() } - p.AddNominatedPod(logger, pInfo.PodInfo, nil) return nil } @@ -863,7 +862,6 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(logger klog.Logger, pInfo * p.cond.Broadcast() } - p.AddNominatedPod(logger, pInfo.PodInfo, nil) return nil } diff --git a/pkg/scheduler/internal/queue/scheduling_queue_test.go b/pkg/scheduler/internal/queue/scheduling_queue_test.go index 95297d92445..32549f1aad7 100644 --- a/pkg/scheduler/internal/queue/scheduling_queue_test.go +++ b/pkg/scheduler/internal/queue/scheduling_queue_test.go @@ -865,18 +865,6 @@ func TestPriorityQueue_AddUnschedulableIfNotPresent(t *testing.T) { if err != nil { t.Fatalf("unexpected error from AddUnschedulableIfNotPresent: %v", err) } - expectedNominatedPods := &nominator{ - nominatedPodToNode: map[types.UID]string{ - unschedulablePodInfo.Pod.UID: "node1", - highPriNominatedPodInfo.Pod.UID: "node1", - }, - nominatedPods: map[string][]PodRef{ - "node1": {PodToRef(highPriNominatedPodInfo.Pod), PodToRef(unschedulablePodInfo.Pod)}, - }, - } - if diff := cmp.Diff(q.nominator, expectedNominatedPods, nominatorCmpOpts...); diff != "" { - t.Errorf("Unexpected diff after adding pods (-want, +got):\n%s", diff) - } if p, err := q.Pop(logger); err != nil || p.Pod != highPriNominatedPodInfo.Pod { t.Errorf("Expected: %v after Pop, but got: %v", highPriNominatedPodInfo.Pod.Name, p.Pod.Name) }