Merge pull request #46545 from thaJeztah/libnetwork_NetworkByID_simplify

libnetwork: Controller.NetworkByID: remove redundant error-handling
This commit is contained in:
Sebastiaan van Stijn 2023-09-27 10:30:47 +02:00 committed by GitHub
commit 324cb3d08f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -870,13 +870,7 @@ func (c *Controller) NetworkByID(id string) (*Network, error) {
if id == "" {
return nil, ErrInvalidID(id)
}
n, err := c.getNetworkFromStore(id)
if err != nil {
return nil, ErrNoSuchNetwork(id)
}
return n, nil
return c.getNetworkFromStore(id)
}
// NewSandbox creates a new sandbox for containerID.