Skip to content

Commit

Permalink
fix filter NotReady node
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyuqing4 committed Nov 7, 2019
1 parent 124d6aa commit b9741c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/scheduler/api/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ func (ni *NodeInfo) setNodeState(node *v1.Node) {
return
}

// 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",
}
return
}
}

// Node is ready (ignore node conditions because of taint/toleration)
ni.State = NodeState{
Phase: Ready,
Expand Down

0 comments on commit b9741c1

Please sign in to comment.