chore: remove unnecessary check for node is zero

This commit is contained in:
googs1025 2025-02-18 09:13:09 +08:00
parent d1126b66cb
commit 004c5f5a39
3 changed files with 0 additions and 10 deletions

View File

@ -130,10 +130,6 @@ func (pl *InterPodAffinity) PreScore(
pod *v1.Pod,
nodes []*framework.NodeInfo,
) *framework.Status {
if len(nodes) == 0 {
// No nodes to score.
return framework.NewStatus(framework.Skip)
}
if pl.sharedLister == nil {
return framework.NewStatus(framework.Error, "empty shared lister in InterPodAffinity PreScore")

View File

@ -238,9 +238,6 @@ func (s *preScoreState) Clone() framework.StateData {
// PreScore builds and writes cycle state used by Score and NormalizeScore.
func (pl *NodeAffinity) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status {
if len(nodes) == 0 {
return nil
}
preferredNodeAffinity, err := getPodPreferredNodeAffinity(pod)
if err != nil {
return framework.AsStatus(err)

View File

@ -143,9 +143,6 @@ func getAllTolerationPreferNoSchedule(tolerations []v1.Toleration) (tolerationLi
// PreScore builds and writes cycle state used by Score and NormalizeScore.
func (pl *TaintToleration) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status {
if len(nodes) == 0 {
return nil
}
tolerationsPreferNoSchedule := getAllTolerationPreferNoSchedule(pod.Spec.Tolerations)
state := &preScoreState{
tolerationsPreferNoSchedule: tolerationsPreferNoSchedule,