mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix 'failed to get network during CreateEndpoint'
Fix 'failed to get network during CreateEndpoint' during container starting. Change the error type to `libnetwork.ErrNoSuchNetwork`, so `Start()` in `daemon/cluster/executor/container/controller.go` will recreate the network. Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
This commit is contained in:
parent
fd1765ca9b
commit
0c8ffda2ab
2 changed files with 3 additions and 2 deletions
|
@ -1181,7 +1181,8 @@ func (n *network) createEndpoint(name string, options ...EndpointOption) (Endpoi
|
|||
ep.locator = n.getController().clusterHostID()
|
||||
ep.network, err = ep.getNetworkFromStore()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get network during CreateEndpoint: %v", err)
|
||||
logrus.Errorf("failed to get network during CreateEndpoint: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
n = ep.network
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ func (c *controller) getNetworkFromStore(nid string) (*network, error) {
|
|||
return n, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("network %s not found", nid)
|
||||
return nil, ErrNoSuchNetwork(nid)
|
||||
}
|
||||
|
||||
func (c *controller) getNetworksForScope(scope string) ([]*network, error) {
|
||||
|
|
Loading…
Reference in a new issue