Skip to content

Commit

Permalink
Merge pull request #2554 from xinfengliu/fix-network-not-found
Browse files Browse the repository at this point in the history
Fix 'failed to get network during CreateEndpoint'
  • Loading branch information
arkodg authored Jun 2, 2020
2 parents ca3700b + 1df7f7e commit 868f23b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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, err
}
n = ep.network

Expand Down
2 changes: 1 addition & 1 deletion store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 868f23b

Please sign in to comment.