endpointslice API: rename 'accepting' condition to 'serving' condition
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This commit is contained in:
@@ -664,7 +664,7 @@ func TestSyncService(t *testing.T) {
|
||||
{
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(true),
|
||||
Accepting: utilpointer.BoolPtr(true),
|
||||
Serving: utilpointer.BoolPtr(true),
|
||||
Terminating: utilpointer.BoolPtr(false),
|
||||
},
|
||||
Addresses: []string{"10.0.0.1"},
|
||||
@@ -674,7 +674,7 @@ func TestSyncService(t *testing.T) {
|
||||
{
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(false),
|
||||
Accepting: utilpointer.BoolPtr(true),
|
||||
Serving: utilpointer.BoolPtr(true),
|
||||
Terminating: utilpointer.BoolPtr(true),
|
||||
},
|
||||
Addresses: []string{"10.0.0.2"},
|
||||
@@ -884,7 +884,7 @@ func TestSyncService(t *testing.T) {
|
||||
{
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(true),
|
||||
Accepting: utilpointer.BoolPtr(true),
|
||||
Serving: utilpointer.BoolPtr(true),
|
||||
Terminating: utilpointer.BoolPtr(false),
|
||||
},
|
||||
Addresses: []string{"10.0.0.1"},
|
||||
@@ -894,7 +894,7 @@ func TestSyncService(t *testing.T) {
|
||||
{
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(false),
|
||||
Accepting: utilpointer.BoolPtr(false),
|
||||
Serving: utilpointer.BoolPtr(false),
|
||||
Terminating: utilpointer.BoolPtr(true),
|
||||
},
|
||||
Addresses: []string{"10.0.0.2"},
|
||||
|
@@ -178,7 +178,7 @@ func TestReconcile1Pod(t *testing.T) {
|
||||
Addresses: []string{"1.2.3.4"},
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(true),
|
||||
Accepting: utilpointer.BoolPtr(true),
|
||||
Serving: utilpointer.BoolPtr(true),
|
||||
Terminating: utilpointer.BoolPtr(false),
|
||||
},
|
||||
Topology: map[string]string{
|
||||
|
@@ -62,11 +62,11 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service,
|
||||
}
|
||||
}
|
||||
|
||||
accepting := podutil.IsPodReady(pod)
|
||||
serving := podutil.IsPodReady(pod)
|
||||
terminating := pod.DeletionTimestamp != nil
|
||||
// For compatibility reasons, "ready" should never be "true" if a pod is terminatng, unless
|
||||
// publishNotReadyAddresses was set.
|
||||
ready := service.Spec.PublishNotReadyAddresses || (accepting && !terminating)
|
||||
ready := service.Spec.PublishNotReadyAddresses || (serving && !terminating)
|
||||
ep := discovery.Endpoint{
|
||||
Addresses: getEndpointAddresses(pod.Status, service, addressType),
|
||||
Conditions: discovery.EndpointConditions{
|
||||
@@ -83,7 +83,7 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service,
|
||||
}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) {
|
||||
ep.Conditions.Accepting = &accepting
|
||||
ep.Conditions.Serving = &serving
|
||||
ep.Conditions.Terminating = &terminating
|
||||
}
|
||||
|
||||
|
@@ -396,7 +396,7 @@ func TestPodToEndpoint(t *testing.T) {
|
||||
Addresses: []string{"1.2.3.5"},
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(true),
|
||||
Accepting: utilpointer.BoolPtr(true),
|
||||
Serving: utilpointer.BoolPtr(true),
|
||||
Terminating: utilpointer.BoolPtr(false),
|
||||
},
|
||||
Topology: map[string]string{"kubernetes.io/hostname": "node-1"},
|
||||
@@ -438,7 +438,7 @@ func TestPodToEndpoint(t *testing.T) {
|
||||
Addresses: []string{"1.2.3.5"},
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(false),
|
||||
Accepting: utilpointer.BoolPtr(true),
|
||||
Serving: utilpointer.BoolPtr(true),
|
||||
Terminating: utilpointer.BoolPtr(true),
|
||||
},
|
||||
Topology: map[string]string{"kubernetes.io/hostname": "node-1"},
|
||||
@@ -480,7 +480,7 @@ func TestPodToEndpoint(t *testing.T) {
|
||||
Addresses: []string{"1.2.3.5"},
|
||||
Conditions: discovery.EndpointConditions{
|
||||
Ready: utilpointer.BoolPtr(false),
|
||||
Accepting: utilpointer.BoolPtr(false),
|
||||
Serving: utilpointer.BoolPtr(false),
|
||||
Terminating: utilpointer.BoolPtr(true),
|
||||
},
|
||||
Topology: map[string]string{"kubernetes.io/hostname": "node-1"},
|
||||
|
Reference in New Issue
Block a user