From ef25f0aa52fdcd6c5b1ec4c66024f5e7bafb5c29 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 21 Jan 2024 21:21:59 +0100 Subject: [PATCH] api: POST /build: remove version-gate for "pull" (api < v1.16) The "pull" option was added in API v1.16 (Docker Engine v1.4.0) in commit 054e57a622e6a065c343806e7334920d17a03c5b, which gated the option by API version. API v1.23 and older are deprecated, so we can remove the gate. Signed-off-by: Sebastiaan van Stijn --- api/server/router/build/build_routes.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/server/router/build/build_routes.go b/api/server/router/build/build_routes.go index 11a7108a51..186e8e483b 100644 --- a/api/server/router/build/build_routes.go +++ b/api/server/router/build/build_routes.go @@ -42,6 +42,7 @@ func newImageBuildOptions(ctx context.Context, r *http.Request) (*types.ImageBui SuppressOutput: httputils.BoolValue(r, "q"), NoCache: httputils.BoolValue(r, "nocache"), ForceRemove: httputils.BoolValue(r, "forcerm"), + PullParent: httputils.BoolValue(r, "pull"), MemorySwap: httputils.Int64ValueOrZero(r, "memswap"), Memory: httputils.Int64ValueOrZero(r, "memory"), CPUShares: httputils.Int64ValueOrZero(r, "cpushares"), @@ -74,9 +75,6 @@ func newImageBuildOptions(ctx context.Context, r *http.Request) (*types.ImageBui options.Remove = httputils.BoolValue(r, "rm") } version := httputils.VersionFromContext(ctx) - if httputils.BoolValue(r, "pull") && versions.GreaterThanOrEqualTo(version, "1.16") { - options.PullParent = true - } if versions.GreaterThanOrEqualTo(version, "1.32") { options.Platform = r.FormValue("platform") }