瀏覽代碼

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 <github@gone.nl>
Sebastiaan van Stijn 1 年之前
父節點
當前提交
ef25f0aa52
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      api/server/router/build/build_routes.go

+ 1 - 3
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"),
 		SuppressOutput: httputils.BoolValue(r, "q"),
 		NoCache:        httputils.BoolValue(r, "nocache"),
 		NoCache:        httputils.BoolValue(r, "nocache"),
 		ForceRemove:    httputils.BoolValue(r, "forcerm"),
 		ForceRemove:    httputils.BoolValue(r, "forcerm"),
+		PullParent:     httputils.BoolValue(r, "pull"),
 		MemorySwap:     httputils.Int64ValueOrZero(r, "memswap"),
 		MemorySwap:     httputils.Int64ValueOrZero(r, "memswap"),
 		Memory:         httputils.Int64ValueOrZero(r, "memory"),
 		Memory:         httputils.Int64ValueOrZero(r, "memory"),
 		CPUShares:      httputils.Int64ValueOrZero(r, "cpushares"),
 		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")
 		options.Remove = httputils.BoolValue(r, "rm")
 	}
 	}
 	version := httputils.VersionFromContext(ctx)
 	version := httputils.VersionFromContext(ctx)
-	if httputils.BoolValue(r, "pull") && versions.GreaterThanOrEqualTo(version, "1.16") {
-		options.PullParent = true
-	}
 	if versions.GreaterThanOrEqualTo(version, "1.32") {
 	if versions.GreaterThanOrEqualTo(version, "1.32") {
 		options.Platform = r.FormValue("platform")
 		options.Platform = r.FormValue("platform")
 	}
 	}