diff --git a/docs/node.md b/docs/node.md index d6c260d42b3..6f9933953c1 100644 --- a/docs/node.md +++ b/docs/node.md @@ -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", }, ] ``` diff --git a/pkg/api/types.go b/pkg/api/types.go index 16b94d89124..1d1d2ada87a 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -449,13 +449,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" ) diff --git a/pkg/api/v1beta1/conversion.go b/pkg/api/v1beta1/conversion.go index eb898663eaf..059295c072d 100644 --- a/pkg/api/v1beta1/conversion.go +++ b/pkg/api/v1beta1/conversion.go @@ -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 diff --git a/pkg/api/v1beta2/conversion.go b/pkg/api/v1beta2/conversion.go index a14e83a09bf..48c7ab55d8a 100644 --- a/pkg/api/v1beta2/conversion.go +++ b/pkg/api/v1beta2/conversion.go @@ -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 diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 3b0620b798a..3c5790cf98b 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -463,13 +463,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" ) diff --git a/pkg/cloudprovider/controller/nodecontroller.go b/pkg/cloudprovider/controller/nodecontroller.go index 75db78f2411..52799e8b422 100644 --- a/pkg/cloudprovider/controller/nodecontroller.go +++ b/pkg/cloudprovider/controller/nodecontroller.go @@ -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) diff --git a/pkg/cloudprovider/controller/nodecontroller_test.go b/pkg/cloudprovider/controller/nodecontroller_test.go index ab731446580..ad46a94e8ad 100644 --- a/pkg/cloudprovider/controller/nodecontroller_test.go +++ b/pkg/cloudprovider/controller/nodecontroller_test.go @@ -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, diff --git a/pkg/kubectl/resource_printer.go b/pkg/kubectl/resource_printer.go index db72ddda167..354fa17626f 100644 --- a/pkg/kubectl/resource_printer.go +++ b/pkg/kubectl/resource_printer.go @@ -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)) diff --git a/pkg/kubectl/resource_printer_test.go b/pkg/kubectl/resource_printer_test.go index ba5f5c4232c..208ab219c60 100644 --- a/pkg/kubectl/resource_printer_test.go +++ b/pkg/kubectl/resource_printer_test.go @@ -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", }, diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 93a6fdcdbfe..c60046ef9dc 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1852,7 +1852,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, } @@ -1939,11 +1939,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 diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index e0e9a0c7251..f3fb3b1b201 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -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 diff --git a/pkg/master/pod_cache.go b/pkg/master/pod_cache.go index a146e0ddf78..93007872b58 100644 --- a/pkg/master/pod_cache.go +++ b/pkg/master/pod_cache.go @@ -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...) diff --git a/pkg/master/pod_cache_test.go b/pkg/master/pod_cache_test.go index 859d44cc65b..a327831be38 100644 --- a/pkg/master/pod_cache_test.go +++ b/pkg/master/pod_cache_test.go @@ -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}, }}, } } diff --git a/pkg/service/endpoints_controller.go b/pkg/service/endpoints_controller.go index 3efcac5e298..434200d2a86 100644 --- a/pkg/service/endpoints_controller.go +++ b/pkg/service/endpoints_controller.go @@ -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 } diff --git a/pkg/service/endpoints_controller_test.go b/pkg/service/endpoints_controller_test.go index 5c2cbbebdf0..ba9eef5c0a3 100644 --- a/pkg/service/endpoints_controller_test.go +++ b/pkg/service/endpoints_controller_test.go @@ -52,7 +52,7 @@ func newPodList(count int) *api.PodList { Conditions: []api.PodCondition{ { Type: api.PodReady, - Status: api.ConditionFull, + Status: api.ConditionTrue, }, }, }, diff --git a/plugin/pkg/scheduler/factory/factory.go b/plugin/pkg/scheduler/factory/factory.go index 796327947ec..9ebb67634ed 100644 --- a/plugin/pkg/scheduler/factory/factory.go +++ b/plugin/pkg/scheduler/factory/factory.go @@ -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 { diff --git a/plugin/pkg/scheduler/factory/factory_test.go b/plugin/pkg/scheduler/factory/factory_test.go index d4ce474480f..4da60254090 100644 --- a/plugin/pkg/scheduler/factory/factory_test.go +++ b/plugin/pkg/scheduler/factory/factory_test.go @@ -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}}, }, }, },