mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-08 19:08:40 -05:00
[node operator] node state util function
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
d62ae3add3
commit
df4e8b2c1e
15
operators/constellation-node-operator/internal/node/node.go
Normal file
15
operators/constellation-node-operator/internal/node/node.go
Normal 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
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user