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

@@ -339,12 +339,6 @@ func (nc *NodeController) DoCheck(node *api.Node) []api.NodeCondition {
}
conditions = append(conditions, *newReadyCondition)
// Check Condition: NodeSchedulable
oldSchedulableCondition := nc.getCondition(&node.Status, api.NodeSchedulable)
newSchedulableCondition := nc.checkNodeSchedulable(node)
nc.updateLastTransitionTime(oldSchedulableCondition, newSchedulableCondition)
conditions = append(conditions, *newSchedulableCondition)
return conditions
}
@@ -360,25 +354,6 @@ func (nc *NodeController) updateLastTransitionTime(oldCondition, newCondition *a
}
}
// checkNodeSchedulable checks node schedulable condition, without transition timestamp set.
func (nc *NodeController) checkNodeSchedulable(node *api.Node) *api.NodeCondition {
if node.Spec.Unschedulable {
return &api.NodeCondition{
Type: api.NodeSchedulable,
Status: api.ConditionFalse,
Reason: "User marked unschedulable during node create/update",
LastProbeTime: nc.now(),
}
} else {
return &api.NodeCondition{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastProbeTime: nc.now(),
}
}
}
// checkNodeReady checks raw node ready condition, without transition timestamp set.
func (nc *NodeController) checkNodeReady(node *api.Node) *api.NodeCondition {
switch status, err := nc.kubeletClient.HealthCheck(node.Name); {

View File

@@ -625,13 +625,6 @@ func TestNodeConditionsCheck(t *testing.T) {
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
},
},
{
@@ -650,18 +643,10 @@ func TestNodeConditionsCheck(t *testing.T) {
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
},
},
{
// User specified node as unschedulable and kubelet /healthz probe returns failure with some error.
// Expected node condition to be not ready and marked unschedulable.
// Expected node condition to be not ready as marking Node Unschedulable does not impact Readiness.
node: &api.Node{ObjectMeta: api.ObjectMeta{Name: "node0"}, Spec: api.NodeSpec{Unschedulable: true}},
fakeKubeletClient: &FakeKubeletClient{
Status: probe.Failure,
@@ -675,13 +660,6 @@ func TestNodeConditionsCheck(t *testing.T) {
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
{
Type: api.NodeSchedulable,
Status: api.ConditionFalse,
Reason: "User marked unschedulable during node create/update",
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
},
},
}
@@ -764,13 +742,6 @@ func TestSyncProbedNodeStatus(t *testing.T) {
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
},
Addresses: []api.NodeAddress{
{Type: api.NodeLegacyHostIP, Address: "1.2.3.4"},
@@ -795,13 +766,6 @@ func TestSyncProbedNodeStatus(t *testing.T) {
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastProbeTime: fakeNow,
LastTransitionTime: fakeNow,
},
},
Addresses: []api.NodeAddress{
{Type: api.NodeLegacyHostIP, Address: "1.2.3.4"},
@@ -868,12 +832,6 @@ func TestSyncProbedNodeStatusTransitionTime(t *testing.T) {
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
},
{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
},
},
},
},
@@ -903,12 +861,6 @@ func TestSyncProbedNodeStatusTransitionTime(t *testing.T) {
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
},
{
Type: api.NodeSchedulable,
Status: api.ConditionTrue,
Reason: "Node is schedulable by default",
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
},
},
},
},