tests: add T/F/Unk. status to node ready condition
Rook previously relied on the presence of `Ready` to determine if a node is ready, but `Ready` can have different statuses. Correct this. https://kubernetes.io/docs/concepts/architecture/nodes/#condition Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
This commit is contained in:
3 files changed
+4
-4
No files matched your search
@@ -222,7 +222,7 @@ func TestCheckHealthTwoMonsOneNode(t *testing.T) {
|
||||
Status: v1.NodeStatus{
|
||||
Conditions: []v1.NodeCondition{
|
||||
{
|
||||
Type: v1.NodeReady,
|
||||
Type: v1.NodeReady, Status: v1.ConditionTrue,
|
||||
},
|
||||
},
|
||||
Addresses: []v1.NodeAddress{
|
||||
@@ -310,7 +310,7 @@ func TestCheckMonsValid(t *testing.T) {
|
||||
Status: v1.NodeStatus{
|
||||
Conditions: []v1.NodeCondition{
|
||||
{
|
||||
Type: v1.NodeReady,
|
||||
Type: v1.NodeReady, Status: v1.ConditionTrue,
|
||||
},
|
||||
},
|
||||
Addresses: []v1.NodeAddress{
|
||||
|
||||
@@ -79,7 +79,7 @@ func createNode(nodeName string, condition v1.NodeConditionType, clientset *fake
|
||||
Status: v1.NodeStatus{
|
||||
Conditions: []v1.NodeCondition{
|
||||
{
|
||||
Type: condition,
|
||||
Type: condition, Status: v1.ConditionTrue,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
func New(nodes int) *fake.Clientset {
|
||||
clientset := fake.NewSimpleClientset()
|
||||
for i := 0; i < nodes; i++ {
|
||||
ready := v1.NodeCondition{Type: v1.NodeReady}
|
||||
ready := v1.NodeCondition{Type: v1.NodeReady, Status: v1.ConditionTrue}
|
||||
name := fmt.Sprintf("node%d", i)
|
||||
n := &v1.Node{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
||||
Reference in new issue
Block a user