From 19a04efa2f1cc7bc6a6d1567c63202a68e643c98 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 22 Jan 2024 00:36:13 +0100 Subject: [PATCH] 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 --- daemon/config/config.go | 8 ++++---- daemon/config/config_linux.go | 3 --- daemon/config/config_windows.go | 7 ------- hack/make/.integration-daemon-start | 3 --- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/daemon/config/config.go b/daemon/config/config.go index 6e01495b08..8b867b953a 100644 --- a/daemon/config/config.go +++ b/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) diff --git a/daemon/config/config_linux.go b/daemon/config/config_linux.go index 2c2aabafd6..986677a0ac 100644 --- a/daemon/config/config_linux.go +++ b/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" diff --git a/daemon/config/config_windows.go b/daemon/config/config_windows.go index 825b150f85..05e185da88 100644 --- a/daemon/config/config_windows.go +++ b/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 diff --git a/hack/make/.integration-daemon-start b/hack/make/.integration-daemon-start index 503425ae2e..cf8002afba 100644 --- a/hack/make/.integration-daemon-start +++ b/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