[20.10] vendor: libnetwork 05b93e0d3a95952f70c113b0bc5bdb538d7afdd7

full diff: 374259e831...05b93e0d3a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-01-18 13:25:55 +01:00
parent d0a3f3a376
commit e3b9b535bd
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
5 changed files with 31 additions and 19 deletions

View file

@ -3,7 +3,7 @@
# LIBNETWORK_COMMIT is used to build the docker-userland-proxy binary. When
# updating the binary version, consider updating github.com/docker/libnetwork
# in vendor.conf accordingly
: "${LIBNETWORK_COMMIT:=374259e8316124ccf1fc38c0c0f3430f8d0e9c76}"
: "${LIBNETWORK_COMMIT:=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7}"
install_proxy() {
case "$1" in

View file

@ -48,7 +48,7 @@ github.com/grpc-ecosystem/go-grpc-middleware 3c51f7f332123e8be5a157c0802a
# libnetwork
# When updating, also update LIBNETWORK_COMMIT in hack/dockerfile/install/proxy.installer accordingly
github.com/docker/libnetwork 374259e8316124ccf1fc38c0c0f3430f8d0e9c76
github.com/docker/libnetwork 05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
github.com/armon/go-metrics f0300d1749da6fa982027e449ec0c7a145510c3c # v0.4.1

View file

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net"
"runtime"
"strings"
"sync"
"time"
@ -1062,13 +1063,6 @@ func (n *network) delete(force bool, rmLBEndpoint bool) error {
goto removeFromStore
}
if err = n.deleteNetwork(); err != nil {
if !force {
return err
}
logrus.Debugf("driver failed to delete stale network %s (%s): %v", n.Name(), n.ID(), err)
}
n.ipamRelease()
if err = c.updateToStore(n); err != nil {
logrus.Warnf("Failed to update store after ipam release for network %s (%s): %v", n.Name(), n.ID(), err)
@ -1089,8 +1083,19 @@ func (n *network) delete(force bool, rmLBEndpoint bool) error {
c.cleanupServiceDiscovery(n.ID())
// Cleanup the load balancer. On Windows this call is required
// to remove remote loadbalancers in VFP.
c.cleanupServiceBindings(n.ID())
// to remove remote loadbalancers in VFP, and must be performed before
// dataplane network deletion.
if runtime.GOOS == "windows" {
c.cleanupServiceBindings(n.ID())
}
// Delete the network from the dataplane
if err = n.deleteNetwork(); err != nil {
if !force {
return err
}
logrus.Debugf("driver failed to delete stale network %s (%s): %v", n.Name(), n.ID(), err)
}
removeFromStore:
// deleteFromStore performs an atomic delete operation and the

View file

@ -369,12 +369,15 @@ func (c *controller) rmServiceBinding(svcName, svcID, nID, eID, containerName st
// Remove loadbalancer service(if needed) and backend in all
// sandboxes in the network only if the vip is valid.
if entries == 0 {
// The network may well have been deleted before the last
// of the service bindings. That's ok on Linux because
// removing the network sandbox implicitly removes the
// backend service bindings. Windows VFP cleanup requires
// calling cleanupServiceBindings on the network prior to
// deleting the network, performed by network.delete.
// The network may well have been deleted from the store (and
// dataplane) before the last of the service bindings. On Linux that's
// ok because removing the network sandbox from the dataplane
// implicitly cleans up all related dataplane state.
// On the Windows dataplane, VFP policylists must be removed
// independently of the network, and they must be removed before the HNS
// network. Otherwise, policylist removal fails with "network not
// found." On Windows cleanupServiceBindings must be called prior to
// removing the network from the store or dataplane.
n, err := c.NetworkByID(nID)
if err == nil {
n.(*network).rmLBBackend(ip, lb, rmService, fullRemove)

View file

@ -139,12 +139,16 @@ func (n *network) rmLBBackend(ip net.IP, lb *loadBalancer, rmService bool, fullR
if policyLists, ok := lbPolicylistMap[lb]; ok {
if policyLists.ilb != nil {
policyLists.ilb.Delete()
if _, err := policyLists.ilb.Delete(); err != nil {
logrus.Errorf("Failed to remove HNS ILB policylist %s: %s", policyLists.ilb.ID, err)
}
policyLists.ilb = nil
}
if policyLists.elb != nil {
policyLists.elb.Delete()
if _, err := policyLists.elb.Delete(); err != nil {
logrus.Errorf("Failed to remove HNS ELB policylist %s: %s", policyLists.elb.ID, err)
}
policyLists.elb = nil
}
delete(lbPolicylistMap, lb)