Skip to content

Commit

Permalink
Fix 'failed to get network during CreateEndpoint'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
xinfengliu committed May 22, 2020
1 parent 13a4da0 commit 86e8640
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ErrNoSuchNetwork(n.Name())
}
n = ep.network

Expand Down

0 comments on commit 86e8640

Please sign in to comment.