Skip to content

Commit 6684df5

Browse files
committed
express condition positively
1 parent 4c29f13 commit 6684df5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cluster-autoscaler/utils/kubernetes/listers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func ArrangePodsBySchedulability(allPods []*apiv1.Pod, bypassedSchedulers map[st
186186
continue
187187
} else {
188188
_, condition := podv1.GetPodCondition(&pod.Status, apiv1.PodScheduled)
189-
if !(condition == nil || condition.Status != apiv1.ConditionFalse || condition.Reason != apiv1.PodReasonUnschedulable) {
189+
if condition != nil && condition.Status == apiv1.ConditionFalse && condition.Reason == apiv1.PodReasonUnschedulable {
190190
podsBySchedulability.Unschedulable = append(podsBySchedulability.Unschedulable, pod)
191191
} else {
192192
if canBypass := bypassedSchedulers[pod.Spec.SchedulerName]; canBypass {

0 commit comments

Comments
 (0)