diff --git a/libnetwork/endpoint.go b/libnetwork/endpoint.go index 02c7ba3316..865f2aab70 100644 --- a/libnetwork/endpoint.go +++ b/libnetwork/endpoint.go @@ -584,7 +584,8 @@ func (ep *endpoint) Delete() error { ep.Lock() epid := ep.id name := ep.name - if ep.sandboxID != "" { + sb, _ := n.getController().SandboxByID(ep.sandboxID) + if sb != nil { ep.Unlock() return &ActiveContainerError{name: name, id: epid} } diff --git a/libnetwork/test/integration/dnet/multi.bats b/libnetwork/test/integration/dnet/multi.bats index ad773be060..28cac6de3d 100644 --- a/libnetwork/test/integration/dnet/multi.bats +++ b/libnetwork/test/integration/dnet/multi.bats @@ -112,7 +112,7 @@ function is_network_exist() { for j in `seq 1 3`; do - run dnet_cmd $(inst_id2port 2) service unpublish ${osvc}.${oname} + run dnet_cmd $(inst_id2port $i) service unpublish ${osvc}.${oname} echo ${output} [ "$status" -ne 0 ] run dnet_cmd $(inst_id2port $j) network rm ${oname}