mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +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,16 +1052,9 @@ func GetPodsScheduled(workerNodes sets.String, pods *v1.PodList) (scheduledPods,
|
|||||||
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionTrue)
|
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionTrue)
|
||||||
scheduledPods = append(scheduledPods, pod)
|
scheduledPods = append(scheduledPods, pod)
|
||||||
}
|
}
|
||||||
} else {
|
} else if pod.Spec.NodeName == "" {
|
||||||
_, 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)
|
notScheduledPods = append(notScheduledPods, pod)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user