Scheduler NodeInfo cleanup

This commit is contained in:
Abdullah Gharaibeh
2020-04-09 16:31:34 -04:00
parent 0c9245a29f
commit 2c51c13620
27 changed files with 244 additions and 376 deletions

View File

@@ -278,11 +278,11 @@ func (pl *ServiceAffinity) Score(ctx context.Context, state *framework.CycleStat
selector = labels.NewSelector()
}
if len(nodeInfo.Pods()) == 0 || selector.Empty() {
if len(nodeInfo.Pods) == 0 || selector.Empty() {
return 0, nil
}
var score int64
for _, existingPod := range nodeInfo.Pods() {
for _, existingPod := range nodeInfo.Pods {
// Ignore pods being deleted for spreading purposes
// Similar to how it is done for SelectorSpreadPriority
if pod.Namespace == existingPod.Pod.Namespace && existingPod.Pod.DeletionTimestamp == nil {