Remove ConditionSchedulable

This commit is contained in:
gmarek
2015-04-03 15:43:51 +02:00
parent d6851729d2
commit ef56dca6b6
11 changed files with 34 additions and 130 deletions

View File

@@ -249,10 +249,8 @@ func (factory *ConfigFactory) pollMinions() (cache.Enumerator, error) {
cond := node.Status.Conditions[i]
conditionMap[cond.Type] = &cond
}
if condition, ok := conditionMap[api.NodeSchedulable]; ok {
if condition.Status != api.ConditionTrue {
continue
}
if node.Spec.Unschedulable {
continue
}
if condition, ok := conditionMap[api.NodeReady]; ok {
if condition.Status == api.ConditionTrue {

View File

@@ -148,10 +148,8 @@ func TestPollMinions(t *testing.T) {
},
{
ObjectMeta: api.ObjectMeta{Name: "fiz"},
Status: api.NodeStatus{
Conditions: []api.NodeCondition{
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
},
Spec: api.NodeSpec{
Unschedulable: false,
},
},
{
@@ -167,28 +165,34 @@ func TestPollMinions(t *testing.T) {
ObjectMeta: api.ObjectMeta{Name: "fuz"},
Status: api.NodeStatus{
Conditions: []api.NodeCondition{
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
{Type: api.NodeReady, Status: api.ConditionTrue},
},
},
Spec: api.NodeSpec{
Unschedulable: false,
},
},
{
ObjectMeta: api.ObjectMeta{Name: "buz"},
Status: api.NodeStatus{
Conditions: []api.NodeCondition{
{Type: api.NodeSchedulable, Status: api.ConditionFalse},
{Type: api.NodeReady, Status: api.ConditionTrue},
},
},
Spec: api.NodeSpec{
Unschedulable: true,
},
},
{
ObjectMeta: api.ObjectMeta{Name: "foobar"},
Status: api.NodeStatus{
Conditions: []api.NodeCondition{
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
{Type: api.NodeReady, Status: api.ConditionFalse},
},
},
Spec: api.NodeSpec{
Unschedulable: false,
},
},
},
expectedCount: 3,
@@ -218,18 +222,14 @@ func TestPollMinions(t *testing.T) {
minions: []api.Node{
{
ObjectMeta: api.ObjectMeta{Name: "foo"},
Status: api.NodeStatus{
Conditions: []api.NodeCondition{
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
},
Spec: api.NodeSpec{
Unschedulable: false,
},
},
{
ObjectMeta: api.ObjectMeta{Name: "bar"},
Status: api.NodeStatus{
Conditions: []api.NodeCondition{
{Type: api.NodeSchedulable, Status: api.ConditionFalse},
},
Spec: api.NodeSpec{
Unschedulable: true,
},
},
},