libnetwork: only delete svc db entry on network rm

The service db entry for each network is deleted by
(*Controller).cleanupServiceDiscovery() when the network is deleted.
There is no need to also eagerly delete it whenever the network's
endpoint count drops to zero.

Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
Cory Snider 2023-10-17 18:55:28 -04:00
parent c85398b020
commit 804ef16822

View file

@ -239,9 +239,6 @@ func (c *Controller) processEndpointDelete(ep *Endpoint) {
c.mu.Lock()
if len(nw.localEps) == 0 {
// This is the last container going away for the network. Destroy
// this network's svc db entry
delete(c.svcRecords, networkID)
delete(c.nmap, networkID)
}
}