Remove Reachable Condition

This commit is contained in:
Deyuan Deng
2015-03-27 16:36:03 -04:00
committed by Deyuan Deng
parent b9babb56b0
commit 6bb9701489
14 changed files with 878 additions and 587 deletions

View File

@@ -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

View File

@@ -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}},
},
},