Merge pull request #101358 from sbangari/localendpointrefcount

Ref counting is only applicable to Remote endpoints
This commit is contained in:
Kubernetes Prow Robot 2021-05-04 18:21:26 -07:00 committed by GitHub
commit 73c1b2e260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,7 +354,7 @@ func newSourceVIP(hns HostNetworkService, network string, ip string, mac string,
func (ep *endpointsInfo) Cleanup() {
Log(ep, "Endpoint Cleanup", 3)
if ep.refCount != nil {
if !ep.GetIsLocal() && ep.refCount != nil {
*ep.refCount--
// Remove the remote hns endpoint, if no service is referring it
@ -1157,10 +1157,10 @@ func (proxier *Proxier) syncProxyRules() {
} else {
// We only share the refCounts for remote endpoints
ep.refCount = proxier.endPointsRefCount.getRefCount(newHnsEndpoint.hnsID)
*ep.refCount++
}
ep.hnsID = newHnsEndpoint.hnsID
*ep.refCount++
Log(ep, "Endpoint resource found", 3)
}