Commit a85d352d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #37234 from liggitt/revert-flex_node_conditions

Automatic merge from submit-queue Revert "Avoid hard-coding list of Node Conditions" * we don't know how other API consumers are using node conditions (there was no prior expectation that the scheduler would block on custom conditions) * not all conditions map directly to schedulability (e.g. `MemoryPressure`/`DiskPressure`) * not all conditions use True to mean "unschedulable" (e.g. `Ready`) This reverts commit 511b2eca to avoid breaking existing API users and to avoid constraining future uses of the node conditions API
parents 88a80947 c214abb5
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment