Skip to content

Commit b6b8023

Browse files
author
Trapier Marshall
committed
Cleanup VFP during overlay network removal
Deleting a network sandbox on Linux implicitly clears OS (ipvs) load balancer state. Deleting an HNS network on Windows by contrast does not inherently remove its corresponding VFP load balancers. The method to remove load balancers belongs to the network and so must be called prior to or while deleting a network. This commit reverts one line from c47239d, reintroducing a call to explicitly remove backend load balancers during network removal. Signed-off-by: Trapier Marshall <[email protected]>
1 parent 1aa3ae9 commit b6b8023

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

network.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,10 @@ func (n *network) delete(force bool, rmLBEndpoint bool) error {
10881088
// Cleanup the service discovery for this network
10891089
c.cleanupServiceDiscovery(n.ID())
10901090

1091+
// Cleanup the load balancer. On Windows this call is required
1092+
// to remove remote loadbalancers in VFP.
1093+
c.cleanupServiceBindings(n.ID())
1094+
10911095
removeFromStore:
10921096
// deleteFromStore performs an atomic delete operation and the
10931097
// network.epCnt will help prevent any possible

service_common.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,11 @@ func (c *controller) rmServiceBinding(svcName, svcID, nID, eID, containerName st
369369
// sandboxes in the network only if the vip is valid.
370370
if entries == 0 {
371371
// The network may well have been deleted before the last
372-
// of the service bindings. That's ok, because removing
373-
// the network sandbox implicitly removes the backend
374-
// service bindings.
372+
// of the service bindings. That's ok on Linux because
373+
// removing the network sandbox implicitly removes the
374+
// backend service bindings. Windows VFP cleanup requires
375+
// calling cleanupServiceBindings on the network prior to
376+
// deleting the network, performed by network.delete.
375377
n, err := c.NetworkByID(nID)
376378
if err == nil {
377379
n.(*network).rmLBBackend(ip, lb, rmService, fullRemove)

0 commit comments

Comments
 (0)