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:
Blaine Gardner committed 2019-04-09 15:40:37 -06:00
1 parent fa11c4b4d7
commit f126887b52
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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{
+1 -1
View File
@@ -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,
},
},
},
+1 -1
View File
@@ -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{