diff --git a/pkg/proxy/endpoints.go b/pkg/proxy/endpoints.go index fd1e9485cdb..d1c04c78d85 100644 --- a/pkg/proxy/endpoints.go +++ b/pkg/proxy/endpoints.go @@ -117,13 +117,6 @@ func (info *BaseEndpointInfo) Port() (int, error) { return proxyutil.PortPart(info.Endpoint) } -// Equal is part of proxy.Endpoint interface. -func (info *BaseEndpointInfo) Equal(other Endpoint) bool { - return info.String() == other.String() && - info.GetIsLocal() == other.GetIsLocal() && - info.IsReady() == other.IsReady() -} - // GetNodeName returns the NodeName for this endpoint. func (info *BaseEndpointInfo) GetNodeName() string { return info.NodeName @@ -425,7 +418,9 @@ func detectStaleConntrackEntries(oldEndpointsMap, newEndpointsMap EndpointsMap, // ready to not ready. If it did change stale entries for the old // endpoint have to be cleared. for i := range newEndpointsMap[svcPortName] { - if newEndpointsMap[svcPortName][i].Equal(ep) { + if newEndpointsMap[svcPortName][i].String() == ep.String() && + newEndpointsMap[svcPortName][i].IsReady() == ep.IsReady() && + newEndpointsMap[svcPortName][i].GetIsLocal() == ep.GetIsLocal() { deleted = false break } diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index a6132a881d5..9f036d88a10 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -136,19 +136,6 @@ func newEndpointInfo(baseInfo *proxy.BaseEndpointInfo, svcPortName *proxy.Servic } } -// Equal overrides the Equal() function implemented by proxy.BaseEndpointInfo. -func (e *endpointsInfo) Equal(other proxy.Endpoint) bool { - o, ok := other.(*endpointsInfo) - if !ok { - klog.ErrorS(nil, "Failed to cast endpointsInfo") - return false - } - return e.Endpoint == o.Endpoint && - e.IsLocal == o.IsLocal && - e.ChainName == o.ChainName && - e.Ready == o.Ready -} - // Proxier is an iptables based proxy for connections between a localhost:lport // and services that provide the actual backends. type Proxier struct { diff --git a/pkg/proxy/types.go b/pkg/proxy/types.go index 7c9d19ab818..56dc3369407 100644 --- a/pkg/proxy/types.go +++ b/pkg/proxy/types.go @@ -131,8 +131,6 @@ type Endpoint interface { IP() string // Port returns the Port part of the endpoint. Port() (int, error) - // Equal checks if two endpoints are equal. - Equal(Endpoint) bool // GetNodeName returns the node name for the endpoint GetNodeName() string // GetZone returns the zone for the endpoint