pkg/proxy: remove equal method from endpoint interface

Signed-off-by: Daman Arora <aroradaman@gmail.com>
This commit is contained in:
Daman Arora
2023-08-27 18:16:44 +05:30
parent c4f4e3bc43
commit 01df59a73b
3 changed files with 3 additions and 23 deletions

View File

@@ -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
}