Skip to content

Commit

Permalink
Don't depend on ready condition of nodes instead of taints in session
Browse files Browse the repository at this point in the history
Signed-off-by: Monokaix <changxuzheng@huawei.com>
  • Loading branch information
Monokaix committed Sep 30, 2024
1 parent 9712489 commit 080ed1b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/scheduler/api/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,8 @@ func (ni *NodeInfo) setNodeState(node *v1.Node) {
klog.ErrorS(nil, "Node out of sync", "name", ni.Name, "resources", resources)
}

// If node not ready, e.g. power off
for _, cond := range node.Status.Conditions {
if cond.Type == v1.NodeReady && cond.Status != v1.ConditionTrue {
ni.State = NodeState{
Phase: NotReady,
Reason: "NotReady",
}
klog.Warningf("set the node %s status to %s.", node.Name, NotReady.String())
return
}
}

// Node is ready (ignore node conditions because of taint/toleration)
// Node is ready (ignore node conditions because of taint/toleration), for more detail please see
// https://github.com/kubernetes/design-proposals-archive/blob/main/scheduling/taint-node-by-condition.md.
ni.State = NodeState{
Phase: Ready,
Reason: "",
Expand Down

0 comments on commit 080ed1b

Please sign in to comment.