소스 검색

postContainersCreate: minor nitpick

There are two if statements checking for exactly same conditions:

> if hostConfig != nil && versions.LessThan(version, "1.40")

Merge these.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Kir Kolyshkin 6 년 전
부모
커밋
ce7528ebdf
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      api/server/router/container/container_routes.go

+ 1 - 3
api/server/router/container/container_routes.go

@@ -474,10 +474,8 @@ func (s *containerRouter) postContainersCreate(ctx context.Context, w http.Respo
 		}
 		// Ignore KernelMemoryTCP because it was added in API 1.40.
 		hostConfig.KernelMemoryTCP = 0
-	}
 
-	// Ignore Capabilities because it was added in API 1.40.
-	if hostConfig != nil && versions.LessThan(version, "1.40") {
+		// Ignore Capabilities because it was added in API 1.40.
 		hostConfig.Capabilities = nil
 	}