mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
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 <georgedanielmangum@gmail.com>
This commit is contained in:
parent
1cbda2493d
commit
5f904f5e79
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user