1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Cleanup servicebindings only on Windows

Make the call to cleanupServiceBindings during network deletion
conditional on Windows (where it is required), thereby providing a
performance improvement to network cleanup on Linux.

Signed-off-by: Trapier Marshall <tmarshall@mirantis.com>
This commit is contained in:
Trapier Marshall 2021-02-04 03:31:33 -05:00 committed by Olli Janatuinen
parent 6861aade58
commit a46700dbdb

View file

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net"
"runtime"
"strings"
"sync"
"time"
@ -1081,7 +1082,9 @@ func (n *network) delete(force bool, rmLBEndpoint bool) error {
// Cleanup the load balancer. On Windows this call is required
// to remove remote loadbalancers in VFP, and must be performed before
// dataplane network deletion.
c.cleanupServiceBindings(n.ID())
if runtime.GOOS == "windows" {
c.cleanupServiceBindings(n.ID())
}
// Delete the network from the dataplane
if err = n.deleteNetwork(); err != nil {