From c214abb5ffaeb8a8e0fdde164ebe6703b1c58b1e Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Mon, 21 Nov 2016 14:55:11 -0500 Subject: [PATCH] Revert "Avoid hard-coding list of Node Conditions" This reverts commit 511b2ecaa8025364e8ef43427ff08709b056f0cb. --- plugin/pkg/scheduler/factory/factory.go | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/plugin/pkg/scheduler/factory/factory.go b/plugin/pkg/scheduler/factory/factory.go index 3f004682c11..23fd57f274f 100644 --- a/plugin/pkg/scheduler/factory/factory.go +++ b/plugin/pkg/scheduler/factory/factory.go @@ -507,22 +507,15 @@ func getNodeConditionPredicate() cache.NodeConditionPredicate { // - NodeReady condition status is ConditionTrue, // - NodeOutOfDisk condition status is ConditionFalse, // - NodeNetworkUnavailable condition status is ConditionFalse. - switch cond.Type { - case api.NodeReady: - if cond.Status != api.ConditionTrue { - glog.V(4).Infof("Ignoring node %v with %v condition status %v", node.Name, cond.Type, cond.Status) - return false - } - - case api.NodeMemoryPressure, api.NodeDiskPressure: - // We don't block on "pressure" conditions; these are warnings, not errors! - - default: - // We assume everything else is blocking if the condition is True or Unknown - if cond.Status != api.ConditionFalse { - glog.V(4).Infof("Ignoring node %v with %v condition status %v", node.Name, cond.Type, cond.Status) - return false - } + if cond.Type == api.NodeReady && cond.Status != api.ConditionTrue { + glog.V(4).Infof("Ignoring node %v with %v condition status %v", node.Name, cond.Type, cond.Status) + return false + } else if cond.Type == api.NodeOutOfDisk && cond.Status != api.ConditionFalse { + glog.V(4).Infof("Ignoring node %v with %v condition status %v", node.Name, cond.Type, cond.Status) + return false + } else if cond.Type == api.NodeNetworkUnavailable && cond.Status != api.ConditionFalse { + glog.V(4).Infof("Ignoring node %v with %v condition status %v", node.Name, cond.Type, cond.Status) + return false } } // Ignore nodes that are marked unschedulable