// FilterOutSchedulable checks whether pods from <unschedulableCandidates> marked as unschedulable // by Scheduler actually can't be scheduled on any node and filter out the ones that can. func FilterOutSchedulable(unschedulableCandidates []*kube_api.Pod, nodes []*kube_api.Node, allPods []*kube_api.Pod, predicateChecker *simulator.PredicateChecker) []*kube_api.Pod { unschedulablePods := []*kube_api.Pod{} nodeNameToNodeInfo := createNodeNameToInfoMap(allPods, nodes) for _, pod := range unschedulableCandidates { if nodeName, err := predicateChecker.FitsAny(pod, nodeNameToNodeInfo); err == nil { glog.Warningf("Pod %s marked as unschedulable can be scheduled on %s. Ignoring in scale up.", pod.Name, nodeName) } else { unschedulablePods = append(unschedulablePods, pod) } } return unschedulablePods }