mirror of https://github.com/k3s-io/k3s
Merge pull request #36210 from justinsb/flex_node_conditions
Automatic merge from submit-queue Avoid hard-coding list of Node Conditionspull/6/head
commit
05d067d6bb
|
@ -507,17 +507,24 @@ func getNodeConditionPredicate() cache.NodeConditionPredicate {
|
|||
// - NodeReady condition status is ConditionTrue,
|
||||
// - NodeOutOfDisk condition status is ConditionFalse,
|
||||
// - NodeNetworkUnavailable condition status is ConditionFalse.
|
||||
if cond.Type == api.NodeReady && cond.Status != api.ConditionTrue {
|
||||
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
|
||||
} 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 {
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ignore nodes that are marked unschedulable
|
||||
if node.Spec.Unschedulable {
|
||||
glog.V(4).Infof("Ignoring node %v since it is unschedulable", node.Name)
|
||||
|
|
Loading…
Reference in New Issue