Merge pull request #2554 from xinfengliu/fix-network-not-found

Fix 'failed to get network during CreateEndpoint'
This commit is contained in:
Arko Dasgupta 2020-06-02 08:34:55 -07:00 committed by GitHub
commit 778162ba19
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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) {