daemonset don't place pods on notready nodes

This commit is contained in:
Mike Danese
2015-10-28 18:01:34 -07:00
parent c691f66b79
commit f237db81f0
3 changed files with 36 additions and 1 deletions

View File

@@ -87,3 +87,13 @@ func GetPodReadyCondition(status PodStatus) *PodCondition {
}
return nil
}
// IsNodeReady returns true if a node is ready; false otherwise.
func IsNodeReady(node *Node) bool {
for _, c := range node.Status.Conditions {
if c.Type == NodeReady {
return c.Status == ConditionTrue
}
}
return false
}