Merge pull request #101999 from sbangari/automated-cherry-pick-of-#101358-upstream-release-1.19

Automated cherry pick of #101358: Ref counting is only applicable to Remote endpoints
This commit is contained in:
Kubernetes Prow Robot 2021-05-21 10:44:11 -07:00 committed by GitHub
commit 401d6d3f6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,7 +317,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
@ -1112,10 +1112,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)
}