Rename ConditionFull->ConditionTrue, ConditionNone->ConditionFalse
This commit is contained in:
parent
064b7dec42
commit
ca68f4a9d1
@ -52,15 +52,15 @@ sane state but not allowed to accept new pods:
|
||||
"conditions": [
|
||||
{
|
||||
"kind": "Reachable",
|
||||
"status": "Full",
|
||||
"status": "True",
|
||||
},
|
||||
{
|
||||
"kind": "Ready",
|
||||
"status": "Full",
|
||||
"status": "True",
|
||||
},
|
||||
{
|
||||
"kind": "Schedulable",
|
||||
"status": "None",
|
||||
"status": "False",
|
||||
},
|
||||
]
|
||||
```
|
||||
|
@ -437,13 +437,13 @@ type Lifecycle struct {
|
||||
|
||||
type ConditionStatus string
|
||||
|
||||
// These are valid condition statuses. "ConditionFull" means a resource is in the condition;
|
||||
// "ConditionNone" means a resource is not in the condition; "ConditionUnknown" means kubernetes
|
||||
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition;
|
||||
// "ConditionFalse" means a resource is not in the condition; "ConditionUnknown" means kubernetes
|
||||
// can't decide if a resource is in the condition or not. In the future, we could add other
|
||||
// intermediate conditions, e.g. ConditionDegraded.
|
||||
const (
|
||||
ConditionFull ConditionStatus = "Full"
|
||||
ConditionNone ConditionStatus = "None"
|
||||
ConditionTrue ConditionStatus = "True"
|
||||
ConditionFalse ConditionStatus = "False"
|
||||
ConditionUnknown ConditionStatus = "Unknown"
|
||||
)
|
||||
|
||||
|
@ -1291,7 +1291,6 @@ func init() {
|
||||
*out = NodeConditionKind(*in)
|
||||
break
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
func(in *NodeConditionKind, out *newer.NodeConditionType, s conversion.Scope) error {
|
||||
@ -1308,7 +1307,35 @@ func init() {
|
||||
*out = newer.NodeConditionType(*in)
|
||||
break
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
func(in *newer.ConditionStatus, out *ConditionStatus, s conversion.Scope) error {
|
||||
switch *in {
|
||||
case newer.ConditionTrue:
|
||||
*out = ConditionFull
|
||||
break
|
||||
case newer.ConditionFalse:
|
||||
*out = ConditionNone
|
||||
break
|
||||
default:
|
||||
*out = ConditionStatus(*in)
|
||||
break
|
||||
}
|
||||
return nil
|
||||
},
|
||||
func(in *ConditionStatus, out *newer.ConditionStatus, s conversion.Scope) error {
|
||||
switch *in {
|
||||
case ConditionFull:
|
||||
*out = newer.ConditionTrue
|
||||
break
|
||||
case ConditionNone:
|
||||
*out = newer.ConditionFalse
|
||||
break
|
||||
default:
|
||||
*out = newer.ConditionStatus(*in)
|
||||
break
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
@ -1359,6 +1386,7 @@ func init() {
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
func(in *Binding, out *newer.Binding, s conversion.Scope) error {
|
||||
if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
||||
return err
|
||||
|
@ -1219,7 +1219,6 @@ func init() {
|
||||
*out = NodeConditionKind(*in)
|
||||
break
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
func(in *NodeConditionKind, out *newer.NodeConditionType, s conversion.Scope) error {
|
||||
@ -1236,7 +1235,35 @@ func init() {
|
||||
*out = newer.NodeConditionType(*in)
|
||||
break
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
func(in *newer.ConditionStatus, out *ConditionStatus, s conversion.Scope) error {
|
||||
switch *in {
|
||||
case newer.ConditionTrue:
|
||||
*out = ConditionFull
|
||||
break
|
||||
case newer.ConditionFalse:
|
||||
*out = ConditionNone
|
||||
break
|
||||
default:
|
||||
*out = ConditionStatus(*in)
|
||||
break
|
||||
}
|
||||
return nil
|
||||
},
|
||||
func(in *ConditionStatus, out *newer.ConditionStatus, s conversion.Scope) error {
|
||||
switch *in {
|
||||
case ConditionFull:
|
||||
*out = newer.ConditionTrue
|
||||
break
|
||||
case ConditionNone:
|
||||
*out = newer.ConditionFalse
|
||||
break
|
||||
default:
|
||||
*out = newer.ConditionStatus(*in)
|
||||
break
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
@ -1270,7 +1297,6 @@ func init() {
|
||||
*out = PodConditionKind(*in)
|
||||
break
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
func(in *PodConditionKind, out *newer.PodConditionType, s conversion.Scope) error {
|
||||
@ -1284,9 +1310,9 @@ func init() {
|
||||
*out = newer.PodConditionType(*in)
|
||||
break
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
func(in *Binding, out *newer.Binding, s conversion.Scope) error {
|
||||
if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
||||
return err
|
||||
|
@ -451,13 +451,13 @@ type Lifecycle struct {
|
||||
|
||||
type ConditionStatus string
|
||||
|
||||
// These are valid condition statuses. "ConditionFull" means a resource is in the condition;
|
||||
// "ConditionNone" means a resource is not in the condition; "ConditionUnknown" means kubernetes
|
||||
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition;
|
||||
// "ConditionFalse" means a resource is not in the condition; "ConditionUnknown" means kubernetes
|
||||
// can't decide if a resource is in the condition or not. In the future, we could add other
|
||||
// intermediate conditions, e.g. ConditionDegraded.
|
||||
const (
|
||||
ConditionFull ConditionStatus = "Full"
|
||||
ConditionNone ConditionStatus = "None"
|
||||
ConditionTrue ConditionStatus = "True"
|
||||
ConditionFalse ConditionStatus = "False"
|
||||
ConditionUnknown ConditionStatus = "Unknown"
|
||||
)
|
||||
|
||||
|
@ -301,7 +301,7 @@ func (nc *NodeController) DoCheck(node *api.Node) []api.NodeCondition {
|
||||
oldReadyCondition := nc.getCondition(node, api.NodeReady)
|
||||
newReadyCondition := nc.checkNodeReady(node)
|
||||
nc.updateLastTransitionTime(oldReadyCondition, newReadyCondition)
|
||||
if newReadyCondition.Status != api.ConditionFull {
|
||||
if newReadyCondition.Status != api.ConditionTrue {
|
||||
// Node is not ready for this probe, we need to check if pods need to be deleted.
|
||||
if newReadyCondition.LastProbeTime.After(newReadyCondition.LastTransitionTime.Add(nc.podEvictionTimeout)) {
|
||||
// As long as the node fails, we call delete pods to delete all pods. Node controller sync
|
||||
@ -338,14 +338,14 @@ func (nc *NodeController) checkNodeSchedulable(node *api.Node) *api.NodeConditio
|
||||
if node.Spec.Unschedulable {
|
||||
return &api.NodeCondition{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
Reason: "User marked unschedulable during node create/update",
|
||||
LastProbeTime: nc.now(),
|
||||
}
|
||||
} else {
|
||||
return &api.NodeCondition{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastProbeTime: nc.now(),
|
||||
}
|
||||
@ -366,14 +366,14 @@ func (nc *NodeController) checkNodeReady(node *api.Node) *api.NodeCondition {
|
||||
case status == probe.Failure:
|
||||
return &api.NodeCondition{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
Reason: fmt.Sprintf("Node health check failed: kubelet /healthz endpoint returns not ok"),
|
||||
LastProbeTime: nc.now(),
|
||||
}
|
||||
default:
|
||||
return &api.NodeCondition{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: fmt.Sprintf("Node health check succeeded: kubelet /healthz endpoint returns ok"),
|
||||
LastProbeTime: nc.now(),
|
||||
}
|
||||
@ -481,7 +481,7 @@ func (nc *NodeController) MonitorNodeStatus() error {
|
||||
|
||||
if readyCondition != nil {
|
||||
// Check eviction timeout.
|
||||
if lastReadyCondition.Status == api.ConditionNone &&
|
||||
if lastReadyCondition.Status == api.ConditionFalse &&
|
||||
nc.now().After(lastReadyCondition.LastTransitionTime.Add(nc.podEvictionTimeout)) {
|
||||
// Node stays in not ready for at least 'podEvictionTimeout' - evict all pods on the unhealthy node.
|
||||
nc.deletePods(node.Name)
|
||||
|
@ -580,14 +580,14 @@ func TestNodeConditionsCheck(t *testing.T) {
|
||||
expectedConditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
},
|
||||
{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
@ -605,14 +605,14 @@ func TestNodeConditionsCheck(t *testing.T) {
|
||||
expectedConditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
Reason: "Node health check failed: kubelet /healthz endpoint returns not ok",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
},
|
||||
{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
@ -637,7 +637,7 @@ func TestNodeConditionsCheck(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
Reason: "User marked unschedulable during node create/update",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
@ -719,14 +719,14 @@ func TestSyncProbedNodeStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
},
|
||||
{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
@ -743,14 +743,14 @@ func TestSyncProbedNodeStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
},
|
||||
{
|
||||
Type: api.NodeSchedulable,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
@ -810,13 +810,13 @@ func TestSyncProbedNodeStatusTransitionTime(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
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.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||
},
|
||||
@ -845,13 +845,13 @@ func TestSyncProbedNodeStatusTransitionTime(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
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.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node is schedulable by default",
|
||||
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||
},
|
||||
@ -906,7 +906,7 @@ func TestSyncProbedNodeStatusEvictPods(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
|
||||
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||
},
|
||||
@ -936,7 +936,7 @@ func TestSyncProbedNodeStatusEvictPods(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: "Node health check succeeded: kubelet /healthz endpoint returns ok",
|
||||
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||
},
|
||||
@ -965,7 +965,7 @@ func TestSyncProbedNodeStatusEvictPods(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
Reason: "Node health check failed: kubelet /healthz endpoint returns not ok",
|
||||
// Here, last transition time is Now(). In node controller, the new condition's probe time is
|
||||
// also Now(). The two calls to Now() yields differnt time due to test execution, but the
|
||||
@ -997,7 +997,7 @@ func TestSyncProbedNodeStatusEvictPods(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
Reason: "Node health check failed: kubelet /healthz endpoint returns not ok",
|
||||
// Here, last transition time is in the past, and in node controller, the
|
||||
// new condition's probe time is Now(). The time difference is larger than
|
||||
@ -1075,7 +1075,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
// Node status has just been updated, and transited to NotReady for 10min.
|
||||
LastProbeTime: util.Date(2015, 1, 1, 11, 59, 0, 0, time.UTC),
|
||||
LastTransitionTime: util.Date(2015, 1, 1, 11, 50, 0, 0, time.UTC),
|
||||
@ -1104,7 +1104,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
// Node status has just been updated, and transited to NotReady for 1hr.
|
||||
LastProbeTime: util.Date(2015, 1, 1, 11, 59, 0, 0, time.UTC),
|
||||
LastTransitionTime: util.Date(2015, 1, 1, 11, 0, 0, 0, time.UTC),
|
||||
@ -1275,7 +1275,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
// Node status hasn't been updated for 1hr.
|
||||
LastProbeTime: util.Date(2015, 1, 1, 11, 0, 0, 0, time.UTC),
|
||||
LastTransitionTime: util.Date(2015, 1, 1, 11, 0, 0, 0, time.UTC),
|
||||
@ -1323,7 +1323,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
// Node status has just been updated.
|
||||
LastProbeTime: fakeNow,
|
||||
LastTransitionTime: fakeNow,
|
||||
|
@ -440,7 +440,7 @@ func printNode(node *api.Node, w io.Writer) error {
|
||||
var status []string
|
||||
for _, validCondition := range NodeAllConditions {
|
||||
if condition, ok := conditionMap[validCondition]; ok {
|
||||
if condition.Status == api.ConditionFull {
|
||||
if condition.Status == api.ConditionTrue {
|
||||
status = append(status, string(condition.Type))
|
||||
} else {
|
||||
status = append(status, "Not"+string(condition.Type))
|
||||
|
@ -524,7 +524,7 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
{
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo1"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionFull}}},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Ready",
|
||||
},
|
||||
@ -532,8 +532,8 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo2"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull}}},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Ready,Reachable",
|
||||
},
|
||||
@ -541,22 +541,22 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo3"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionFull}}},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Ready",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo4"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionNone}}},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionFalse}}},
|
||||
},
|
||||
status: "NotReady",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo5"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: "InvalidValue", Status: api.ConditionFull}}},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: "InvalidValue", Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Unknown",
|
||||
},
|
||||
@ -571,9 +571,9 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo7"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull}}},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Schedulable,Ready,Reachable",
|
||||
},
|
||||
@ -581,9 +581,9 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
minion: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo8"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionNone},
|
||||
{Type: api.NodeReady, Status: api.ConditionNone},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull}}},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFalse},
|
||||
{Type: api.NodeReady, Status: api.ConditionFalse},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "NotSchedulable,NotReady,Reachable",
|
||||
},
|
||||
|
@ -1850,7 +1850,7 @@ func (kl *Kubelet) tryUpdateNodeStatus() error {
|
||||
currentTime := util.Now()
|
||||
newCondition := api.NodeCondition{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: fmt.Sprintf("kubelet is posting ready status"),
|
||||
LastProbeTime: currentTime,
|
||||
}
|
||||
@ -1937,11 +1937,11 @@ func getPhase(spec *api.PodSpec, info api.PodInfo) api.PodPhase {
|
||||
func getPodReadyCondition(spec *api.PodSpec, info api.PodInfo) []api.PodCondition {
|
||||
ready := []api.PodCondition{{
|
||||
Type: api.PodReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
}}
|
||||
unready := []api.PodCondition{{
|
||||
Type: api.PodReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
}}
|
||||
if info == nil {
|
||||
return unready
|
||||
|
@ -2465,11 +2465,11 @@ func TestPodPhaseWithRestartOnFailure(t *testing.T) {
|
||||
func TestGetPodReadyCondition(t *testing.T) {
|
||||
ready := []api.PodCondition{{
|
||||
Type: api.PodReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
}}
|
||||
unready := []api.PodCondition{{
|
||||
Type: api.PodReady,
|
||||
Status: api.ConditionNone,
|
||||
Status: api.ConditionFalse,
|
||||
}}
|
||||
tests := []struct {
|
||||
spec *api.PodSpec
|
||||
@ -3103,7 +3103,7 @@ func TestUpdateNewNodeStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: fmt.Sprintf("kubelet is posting ready status"),
|
||||
LastProbeTime: util.Time{},
|
||||
LastTransitionTime: util.Time{},
|
||||
@ -3157,7 +3157,7 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: fmt.Sprintf("kubelet is posting ready status"),
|
||||
LastProbeTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||
LastTransitionTime: util.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||
@ -3180,7 +3180,7 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
|
||||
Conditions: []api.NodeCondition{
|
||||
{
|
||||
Type: api.NodeReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
Reason: fmt.Sprintf("kubelet is posting ready status"),
|
||||
LastProbeTime: util.Time{}, // placeholder
|
||||
LastTransitionTime: util.Time{}, // placeholder
|
||||
|
@ -198,7 +198,7 @@ func (p *PodCache) computePodStatus(pod *api.Pod) (api.PodStatus, error) {
|
||||
|
||||
// Assigned to an unhealthy node.
|
||||
for _, condition := range nodeStatus.Conditions {
|
||||
if (condition.Type == api.NodeReady || condition.Type == api.NodeReachable) && condition.Status == api.ConditionNone {
|
||||
if (condition.Type == api.NodeReady || condition.Type == api.NodeReachable) && condition.Status == api.ConditionFalse {
|
||||
glog.V(5).Infof("node status: %v, setting pod %q status to unknown", condition, pod.Name)
|
||||
newStatus.Phase = api.PodUnknown
|
||||
newStatus.Conditions = append(newStatus.Conditions, pod.Status.Conditions...)
|
||||
|
@ -228,7 +228,7 @@ func makeHealthyNode(name string, ip string) *api.Node {
|
||||
{Type: api.NodeLegacyHostIP, Address: ip},
|
||||
},
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -238,7 +238,7 @@ func makeUnhealthyNode(name string) *api.Node {
|
||||
return &api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: name},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionNone},
|
||||
{Type: api.NodeReady, Status: api.ConditionFalse},
|
||||
}},
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
||||
|
||||
inService := false
|
||||
for _, c := range pod.Status.Conditions {
|
||||
if c.Type == api.PodReady && c.Status == api.ConditionFull {
|
||||
if c.Type == api.PodReady && c.Status == api.ConditionTrue {
|
||||
inService = true
|
||||
break
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func newPodList(count int) *api.PodList {
|
||||
Conditions: []api.PodCondition{
|
||||
{
|
||||
Type: api.PodReady,
|
||||
Status: api.ConditionFull,
|
||||
Status: api.ConditionTrue,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -216,16 +216,16 @@ func (factory *ConfigFactory) pollMinions() (cache.Enumerator, error) {
|
||||
conditionMap[cond.Type] = &cond
|
||||
}
|
||||
if condition, ok := conditionMap[api.NodeSchedulable]; ok {
|
||||
if condition.Status != api.ConditionFull {
|
||||
if condition.Status != api.ConditionTrue {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if condition, ok := conditionMap[api.NodeReady]; ok {
|
||||
if condition.Status == api.ConditionFull {
|
||||
if condition.Status == api.ConditionTrue {
|
||||
nodes.Items = append(nodes.Items, node)
|
||||
}
|
||||
} else if condition, ok := conditionMap[api.NodeReachable]; ok {
|
||||
if condition.Status == api.ConditionFull {
|
||||
if condition.Status == api.ConditionTrue {
|
||||
nodes.Items = append(nodes.Items, node)
|
||||
}
|
||||
} else {
|
||||
|
@ -143,7 +143,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -151,7 +151,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -159,7 +159,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "fiz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -167,8 +167,8 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "biz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -176,8 +176,8 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "baz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -185,9 +185,9 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "fuz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -195,9 +195,9 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "buz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionNone},
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFalse},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -205,9 +205,9 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foobar"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionNone},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReady, Status: api.ConditionFalse},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -215,8 +215,8 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "fizbiz"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionNone},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFalse},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -229,7 +229,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -237,7 +237,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionNone},
|
||||
{Type: api.NodeReady, Status: api.ConditionFalse},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -250,7 +250,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFull},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -258,7 +258,7 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionNone},
|
||||
{Type: api.NodeSchedulable, Status: api.ConditionFalse},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -271,8 +271,8 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionFull},
|
||||
{Type: api.NodeReachable, Status: api.ConditionNone}},
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
{Type: api.NodeReachable, Status: api.ConditionFalse}},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -284,8 +284,8 @@ func TestPollMinions(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NodeStatus{
|
||||
Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReachable, Status: api.ConditionFull},
|
||||
{Type: "invalidValue", Status: api.ConditionNone}},
|
||||
{Type: api.NodeReachable, Status: api.ConditionTrue},
|
||||
{Type: "invalidValue", Status: api.ConditionFalse}},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user