[node operator] node state util function

Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
Malte Poll 2022-06-27 16:56:41 +02:00 committed by Malte Poll
parent d62ae3add3
commit df4e8b2c1e

View File

@ -0,0 +1,15 @@
package node
import corev1 "k8s.io/api/core/v1"
func Ready(node *corev1.Node) bool {
for _, cond := range node.Status.Conditions {
if cond.Type == corev1.NodeReady {
if cond.Status == corev1.ConditionTrue {
return true
}
return false
}
}
return false
}