From 16daa08c7b9c6e0f4be42a9c88d2ead1f7296a7c Mon Sep 17 00:00:00 2001 From: Aaron U'Ren Date: Fri, 1 Mar 2024 10:39:38 -0600 Subject: [PATCH] feat(NSC): add endpoints that are ready or serving In order to be compliant with upstream network implementation expectations we choose to proxy an endpoint as long as it is either ready OR serving. This means that endpoints that are terminating will still be proxied which makes kube-router conformant with the upstream e2e tests. --- pkg/controllers/proxy/network_services_controller.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/controllers/proxy/network_services_controller.go b/pkg/controllers/proxy/network_services_controller.go index e0e2642e..82566cc8 100644 --- a/pkg/controllers/proxy/network_services_controller.go +++ b/pkg/controllers/proxy/network_services_controller.go @@ -1081,12 +1081,12 @@ func (nsc *NetworkServicesController) buildEndpointSliceInfo() endpointSliceInfo // protocol: TCP // for _, ep := range es.Endpoints { - // Previously, when we used endpoints, we only looked at subsets.addresses and not subsets.notReadyAddresses - // so here we need to limit our endpoints to only the ones that are ready. In the future, we could consider - // changing this to .Serving which continues to include pods that are in Terminating state. For now we keep - // it the same. - if ep.Conditions.Ready == nil || !*ep.Conditions.Ready { - klog.V(2).Infof("Endpoint (with addresses %s) does not have a ready status, skipping...", ep.Addresses) + // We should only look at serving or ready if we want to be compliant with the upstream expectantions of a + // network provider + if (ep.Conditions.Serving == nil || !*ep.Conditions.Serving) && + (ep.Conditions.Ready == nil || !*ep.Conditions.Ready) { + klog.V(2).Infof("Endpoint (with addresses %s) does not have a ready or serving status, skipping...", + ep.Addresses) continue }