From 5f904f5e790cb02d5dfefbd759ba891174535368 Mon Sep 17 00:00:00 2001 From: hasheddan Date: Mon, 29 Jun 2020 07:11:04 -0500 Subject: [PATCH] Do not raise exception if unscheduled Pod status is unknown Currently when checking for unscheduled pods an exception will be raised if a pod is not scheduled and the status is unknown. This update modifies the logic to include any pod without a NodeName in the not scheduled pods returned. Signed-off-by: hasheddan --- test/e2e/scheduling/predicates.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/e2e/scheduling/predicates.go b/test/e2e/scheduling/predicates.go index 0155dc87845..ff74c8cf02c 100644 --- a/test/e2e/scheduling/predicates.go +++ b/test/e2e/scheduling/predicates.go @@ -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