From 6454248b6bdf80f0e823786b10ace46c4cb41650 Mon Sep 17 00:00:00 2001 From: Max Renaud Date: Fri, 1 Apr 2022 15:52:21 +0000 Subject: [PATCH] Moved counting logic to accommodate rebase --- pkg/proxy/ipvs/proxier.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 0dcd8edf35a..28c76622f96 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1999,6 +1999,14 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode // Traffic from an external source will be routed but the reply // will have the POD address and will be discarded. endpoints = clusterEndpoints + + if svcInfo.InternalPolicyLocal() && utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) { + proxier.serviceNoLocalEndpointsInternal.Insert(svcPortName.NamespacedName.String()) + } + + if svcInfo.ExternalPolicyLocal() { + proxier.serviceNoLocalEndpointsExternal.Insert(svcPortName.NamespacedName.String()) + } } } else { endpoints = clusterEndpoints @@ -2009,15 +2017,6 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode for _, epInfo := range endpoints { newEndpoints.Insert(epInfo.String()) } - if onlyNodeLocalEndpoints && len(newEndpoints) == 0 { - if svcInfo.InternalPolicyLocal() && utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) { - proxier.serviceNoLocalEndpointsInternal.Insert(svcPortName.NamespacedName.String()) - } - - if svcInfo.ExternalPolicyLocal() { - proxier.serviceNoLocalEndpointsExternal.Insert(svcPortName.NamespacedName.String()) - } - } // Create new endpoints for _, ep := range newEndpoints.List() {