mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Merge pull request #90313 from tangcong/fix-scheduler-static-checkerr
fix e2e scheduling staticcheck error
This commit is contained in:
commit
f7b9960767
@ -1052,11 +1052,14 @@ func GetPodsScheduled(masterNodes sets.String, pods *v1.PodList) (scheduledPods,
|
|||||||
if pod.Spec.NodeName != "" {
|
if pod.Spec.NodeName != "" {
|
||||||
_, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled)
|
_, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled)
|
||||||
framework.ExpectEqual(scheduledCondition != nil, true)
|
framework.ExpectEqual(scheduledCondition != nil, true)
|
||||||
|
if scheduledCondition != nil {
|
||||||
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionTrue)
|
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionTrue)
|
||||||
scheduledPods = append(scheduledPods, pod)
|
scheduledPods = append(scheduledPods, pod)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled)
|
_, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled)
|
||||||
framework.ExpectEqual(scheduledCondition != nil, true)
|
framework.ExpectEqual(scheduledCondition != nil, true)
|
||||||
|
if scheduledCondition != nil {
|
||||||
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionFalse)
|
framework.ExpectEqual(scheduledCondition.Status, v1.ConditionFalse)
|
||||||
if scheduledCondition.Reason == "Unschedulable" {
|
if scheduledCondition.Reason == "Unschedulable" {
|
||||||
|
|
||||||
@ -1065,5 +1068,6 @@ func GetPodsScheduled(masterNodes sets.String, pods *v1.PodList) (scheduledPods,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user