mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Merge pull request #130224 from googs1025/chore/remove_taint_score
chore(scheduler): remove unnecessary check for node is zero in scheduler plugins
This commit is contained in:
commit
7e33d428ab
@ -130,10 +130,6 @@ func (pl *InterPodAffinity) PreScore(
|
|||||||
pod *v1.Pod,
|
pod *v1.Pod,
|
||||||
nodes []*framework.NodeInfo,
|
nodes []*framework.NodeInfo,
|
||||||
) *framework.Status {
|
) *framework.Status {
|
||||||
if len(nodes) == 0 {
|
|
||||||
// No nodes to score.
|
|
||||||
return framework.NewStatus(framework.Skip)
|
|
||||||
}
|
|
||||||
|
|
||||||
if pl.sharedLister == nil {
|
if pl.sharedLister == nil {
|
||||||
return framework.NewStatus(framework.Error, "empty shared lister in InterPodAffinity PreScore")
|
return framework.NewStatus(framework.Error, "empty shared lister in InterPodAffinity PreScore")
|
||||||
|
@ -238,9 +238,6 @@ func (s *preScoreState) Clone() framework.StateData {
|
|||||||
|
|
||||||
// PreScore builds and writes cycle state used by Score and NormalizeScore.
|
// 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 {
|
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)
|
preferredNodeAffinity, err := getPodPreferredNodeAffinity(pod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return framework.AsStatus(err)
|
return framework.AsStatus(err)
|
||||||
|
@ -143,9 +143,6 @@ func getAllTolerationPreferNoSchedule(tolerations []v1.Toleration) (tolerationLi
|
|||||||
|
|
||||||
// PreScore builds and writes cycle state used by Score and NormalizeScore.
|
// 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 {
|
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)
|
tolerationsPreferNoSchedule := getAllTolerationPreferNoSchedule(pod.Spec.Tolerations)
|
||||||
state := &preScoreState{
|
state := &preScoreState{
|
||||||
tolerationsPreferNoSchedule: tolerationsPreferNoSchedule,
|
tolerationsPreferNoSchedule: tolerationsPreferNoSchedule,
|
||||||
|
Loading…
Reference in New Issue
Block a user