Merge pull request #92603 from hasheddan/schedule-part-three

Do not raise exception if unscheduled Pod status is unknown
This commit is contained in:
Kubernetes Prow Robot 2020-06-29 18:35:36 -07:00 committed by GitHub
commit 9fb637152c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1052,15 +1052,8 @@ func GetPodsScheduled(workerNodes sets.String, pods *v1.PodList) (scheduledPods,
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionTrue)
scheduledPods = append(scheduledPods, pod)
}
} else {
_, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled)
framework.ExpectEqual(scheduledCondition != nil, true)
if scheduledCondition != nil {
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionFalse)
if scheduledCondition.Reason == "Unschedulable" {
notScheduledPods = append(notScheduledPods, pod)
}
}
} else if pod.Spec.NodeName == "" {
notScheduledPods = append(notScheduledPods, pod)
}
}
return