mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
pkg/proxy: remove equal method from endpoint interface
Signed-off-by: Daman Arora <aroradaman@gmail.com>
This commit is contained in:
parent
c4f4e3bc43
commit
01df59a73b
@ -117,13 +117,6 @@ func (info *BaseEndpointInfo) Port() (int, error) {
|
|||||||
return proxyutil.PortPart(info.Endpoint)
|
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.
|
// GetNodeName returns the NodeName for this endpoint.
|
||||||
func (info *BaseEndpointInfo) GetNodeName() string {
|
func (info *BaseEndpointInfo) GetNodeName() string {
|
||||||
return info.NodeName
|
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
|
// ready to not ready. If it did change stale entries for the old
|
||||||
// endpoint have to be cleared.
|
// endpoint have to be cleared.
|
||||||
for i := range newEndpointsMap[svcPortName] {
|
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
|
deleted = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -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
|
// Proxier is an iptables based proxy for connections between a localhost:lport
|
||||||
// and services that provide the actual backends.
|
// and services that provide the actual backends.
|
||||||
type Proxier struct {
|
type Proxier struct {
|
||||||
|
@ -131,8 +131,6 @@ type Endpoint interface {
|
|||||||
IP() string
|
IP() string
|
||||||
// Port returns the Port part of the endpoint.
|
// Port returns the Port part of the endpoint.
|
||||||
Port() (int, error)
|
Port() (int, error)
|
||||||
// Equal checks if two endpoints are equal.
|
|
||||||
Equal(Endpoint) bool
|
|
||||||
// GetNodeName returns the node name for the endpoint
|
// GetNodeName returns the node name for the endpoint
|
||||||
GetNodeName() string
|
GetNodeName() string
|
||||||
// GetZone returns the zone for the endpoint
|
// GetZone returns the zone for the endpoint
|
||||||
|
Loading…
Reference in New Issue
Block a user