@@ -1045,23 +1045,20 @@ func translateIPv4ToIPv6(ip string) string {
1045
1045
// GetPodsScheduled returns a number of currently scheduled and not scheduled Pods on worker nodes.
1046
1046
func GetPodsScheduled (workerNodes sets.String , pods * v1.PodList ) (scheduledPods , notScheduledPods []v1.Pod ) {
1047
1047
for _ , pod := range pods .Items {
1048
- if workerNodes .Has (pod .Spec .NodeName ) {
1049
- if pod .Spec .NodeName != "" {
1050
- _ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
1051
- framework .ExpectEqual (scheduledCondition != nil , true )
1052
- if scheduledCondition != nil {
1053
- framework .ExpectEqual (scheduledCondition .Status , v1 .ConditionTrue )
1054
- scheduledPods = append (scheduledPods , pod )
1055
- }
1056
- } else {
1057
- _ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
1058
- framework .ExpectEqual (scheduledCondition != nil , true )
1059
- if scheduledCondition != nil {
1060
- framework .ExpectEqual (scheduledCondition .Status , v1 .ConditionFalse )
1061
- if scheduledCondition .Reason == "Unschedulable" {
1062
-
1063
- notScheduledPods = append (notScheduledPods , pod )
1064
- }
1048
+ if pod .Spec .NodeName != "" && workerNodes .Has (pod .Spec .NodeName ) {
1049
+ _ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
1050
+ framework .ExpectEqual (scheduledCondition != nil , true )
1051
+ if scheduledCondition != nil {
1052
+ framework .ExpectEqual (scheduledCondition .Status , v1 .ConditionTrue )
1053
+ scheduledPods = append (scheduledPods , pod )
1054
+ }
1055
+ } else {
1056
+ _ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
1057
+ framework .ExpectEqual (scheduledCondition != nil , true )
1058
+ if scheduledCondition != nil {
1059
+ framework .ExpectEqual (scheduledCondition .Status , v1 .ConditionFalse )
1060
+ if scheduledCondition .Reason == "Unschedulable" {
1061
+ notScheduledPods = append (notScheduledPods , pod )
1065
1062
}
1066
1063
}
1067
1064
}
0 commit comments