瀏覽代碼

api: remove API < v1.24

Commit 08e4e88482d640b9543d4ba6332109e6b6f2495d (Docker Engine v25.0.0)
deprecated API version v1.23 and lower, but older API versions could be
enabled through the DOCKER_MIN_API_VERSION environment variable.

This patch removes all support for API versions < v1.24.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 年之前
父節點
當前提交
19a04efa2f
共有 4 個文件被更改,包括 4 次插入17 次删除
  1. 4 4
      daemon/config/config.go
  2. 0 3
      daemon/config/config_linux.go
  3. 0 7
      daemon/config/config_windows.go
  4. 0 3
      hack/make/.integration-daemon-start

+ 4 - 4
daemon/config/config.go

@@ -56,8 +56,8 @@ const (
 	DefaultPluginNamespace = "plugins.moby"
 	// defaultMinAPIVersion is the minimum API version supported by the API.
 	// This version can be overridden through the "DOCKER_MIN_API_VERSION"
-	// environment variable. The minimum allowed version is determined
-	// by [minAPIVersion].
+	// environment variable. It currently defaults to the minimum API version
+	// supported by the API server.
 	defaultMinAPIVersion = "1.24"
 	// SeccompProfileDefault is the built-in default seccomp profile.
 	SeccompProfileDefault = "builtin"
@@ -610,8 +610,8 @@ func ValidateMinAPIVersion(ver string) error {
 	if strings.EqualFold(ver[0:1], "v") {
 		return errors.New(`API version must be provided without "v" prefix`)
 	}
-	if versions.LessThan(ver, minAPIVersion) {
-		return errors.Errorf(`minimum supported API version is %s: %s`, minAPIVersion, ver)
+	if versions.LessThan(ver, defaultMinAPIVersion) {
+		return errors.Errorf(`minimum supported API version is %s: %s`, defaultMinAPIVersion, ver)
 	}
 	if versions.GreaterThan(ver, api.DefaultVersion) {
 		return errors.Errorf(`maximum supported API version is %s: %s`, api.DefaultVersion, ver)

+ 0 - 3
daemon/config/config_linux.go

@@ -33,9 +33,6 @@ const (
 	// OCI runtime being shipped with the docker daemon package.
 	StockRuntimeName = "runc"
 
-	// minAPIVersion represents Minimum REST API version supported
-	minAPIVersion = "1.12"
-
 	// userlandProxyBinary is the name of the userland-proxy binary.
 	// In rootless-mode, [rootless.RootlessKitDockerProxyBinary] is used instead.
 	userlandProxyBinary = "docker-proxy"

+ 0 - 7
daemon/config/config_windows.go

@@ -13,13 +13,6 @@ const (
 	// default value. On Windows keep this empty so the value is auto-detected
 	// based on other options.
 	StockRuntimeName = ""
-
-	// minAPIVersion represents Minimum REST API version supported
-	// Technically the first daemon API version released on Windows is v1.25 in
-	// engine version 1.13. However, some clients are explicitly using downlevel
-	// APIs (e.g. docker-compose v2.1 file format) and that is just too restrictive.
-	// Hence also allowing 1.24 on Windows.
-	minAPIVersion string = "1.24"
 )
 
 // BridgeConfig is meant to store all the parameters for both the bridge driver and the default bridge network. On

+ 0 - 3
hack/make/.integration-daemon-start

@@ -46,9 +46,6 @@ export DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE=1
 export DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
 export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}
 
-# Allow testing old API versions
-export DOCKER_MIN_API_VERSION=1.12
-
 # example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G"
 storage_params=""
 if [ -n "$DOCKER_STORAGE_OPTS" ]; then