mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 03:03:40 +00:00
Remove Reachable Condition
This commit is contained in:
@@ -256,14 +256,10 @@ func (factory *ConfigFactory) pollMinions() (cache.Enumerator, error) {
|
||||
if condition.Status == api.ConditionTrue {
|
||||
nodes.Items = append(nodes.Items, node)
|
||||
}
|
||||
} else if condition, ok := conditionMap[api.NodeReachable]; ok {
|
||||
if condition.Status == api.ConditionTrue {
|
||||
nodes.Items = append(nodes.Items, node)
|
||||
}
|
||||
} else {
|
||||
// If no condition is set, we get unknown node condition. In such cases,
|
||||
// do not add the node
|
||||
glog.V(2).Infof("Minion %s is not available. Skipping", node.Name)
|
||||
// do not add the node.
|
||||
glog.V(2).Infof("Minion %s is not available. Skipping", node.Name)
|
||||
}
|
||||
}
|
||||
return &nodeEnumerator{nodes}, nil
|
||||
|
@@ -146,14 +146,6 @@ func TestPollMinions(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "fiz"},
|
||||
Status: api.NodeStatus{
|
||||
@@ -162,15 +154,6 @@ func TestPollMinions(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "biz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "baz"},
|
||||
Status: api.NodeStatus{
|
||||
@@ -186,7 +169,6 @@ func TestPollMinions(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -196,7 +178,6 @@ func TestPollMinions(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFalse},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -206,21 +187,11 @@ func TestPollMinions(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionFalse},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "fizbiz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFalse},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedCount: 5,
|
||||
expectedCount: 3,
|
||||
},
|
||||
{
|
||||
minions: []api.Node{
|
||||
@@ -271,19 +242,6 @@ func TestPollMinions(t *testing.T) {
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFalse}},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedCount: 1,
|
||||
},
|
||||
{
|
||||
minions: []api.Node{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
{Type: "invalidValue", Status: api.ConditionFalse}},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user