Skip to content

Commit 7e33d42

Browse files
authored
Merge pull request kubernetes#130224 from googs1025/chore/remove_taint_score
chore(scheduler): remove unnecessary check for node is zero in scheduler plugins
2 parents d1126b6 + 004c5f5 commit 7e33d42

File tree

3 files changed

+0
-10
lines changed

3 files changed

+0
-10
lines changed

pkg/scheduler/framework/plugins/interpodaffinity/scoring.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ func (pl *InterPodAffinity) PreScore(
130130
pod *v1.Pod,
131131
nodes []*framework.NodeInfo,
132132
) *framework.Status {
133-
if len(nodes) == 0 {
134-
// No nodes to score.
135-
return framework.NewStatus(framework.Skip)
136-
}
137133

138134
if pl.sharedLister == nil {
139135
return framework.NewStatus(framework.Error, "empty shared lister in InterPodAffinity PreScore")

pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ func (s *preScoreState) Clone() framework.StateData {
238238

239239
// PreScore builds and writes cycle state used by Score and NormalizeScore.
240240
func (pl *NodeAffinity) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status {
241-
if len(nodes) == 0 {
242-
return nil
243-
}
244241
preferredNodeAffinity, err := getPodPreferredNodeAffinity(pod)
245242
if err != nil {
246243
return framework.AsStatus(err)

pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ func getAllTolerationPreferNoSchedule(tolerations []v1.Toleration) (tolerationLi
143143

144144
// PreScore builds and writes cycle state used by Score and NormalizeScore.
145145
func (pl *TaintToleration) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status {
146-
if len(nodes) == 0 {
147-
return nil
148-
}
149146
tolerationsPreferNoSchedule := getAllTolerationPreferNoSchedule(pod.Spec.Tolerations)
150147
state := &preScoreState{
151148
tolerationsPreferNoSchedule: tolerationsPreferNoSchedule,

0 commit comments

Comments
 (0)