소스 검색

Merge pull request #46545 from thaJeztah/libnetwork_NetworkByID_simplify

libnetwork: Controller.NetworkByID: remove redundant error-handling
Sebastiaan van Stijn 1 년 전
부모
커밋
324cb3d08f
1개의 변경된 파일1개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 7
      libnetwork/controller.go

+ 1 - 7
libnetwork/controller.go

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