Thanks to visit codestin.com
Credit goes to github.com

Skip to content

client: add support for overriding minimum API version#52046

Open
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:client_min_api_version_override
Open

client: add support for overriding minimum API version#52046
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:client_min_api_version_override

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Feb 15, 2026

This adds options to override the minimum API version considered when performing API-version negotiation. These options allow the client to either downgrade to versions lower than supported (lower than MinAPIVersion), which may result in degraded functionality, or to raise the minimum version to exclude older API versions.

The WithMinAPIVersion can be used to set the version programmatically. The WithMinAPIVersionFromEnv allows a user to set the minimum API version at runtime through the DOCKER_MIN_API_VERSION env-var.

The WithMinAPIVersionFromEnv is more permissive to account for slightly malformed valus in the environment variables; it accepts whitespace, and API versions with a "v" prefix. It also ignores empty values in the environment-variable (which are considered a no-op).

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- client: add `WithMinAPIVersion` and `WithMinAPIVersionFromEnv ` options to allow overriding the minimum API versions considered for API version negotiation. These options allow the client to either downgrade to versions lower than supported (lower than MinAPIVersion), which may result in degraded functionality, or to raise the minimum version to exclude older API versions.
- client: the `FromEnv` option now includes `WithMinAPIVersionFromEnv`, adding support for overriding the minimum API version through a `DOCKER_MIN_API_VERSION` environment variable.

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.3.0 milestone Feb 15, 2026
@thaJeztah thaJeztah added area/api API status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK module/client labels Feb 15, 2026
@thaJeztah thaJeztah force-pushed the client_min_api_version_override branch from 92ecf5d to 24b69e7 Compare February 15, 2026 13:16
Comment on lines +153 to +157
// We allow downgrading the client's minimum version to an unsupported lower version.
doc: "downgrade minimum version",
version: "1.0",
expected: "1.0",
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW; we could apply the same limits as are used for the daemon; the daemon also accepts DOCKER_MIN_API_VERSION as an env-var, but constraints it to 1.24 as that was what we already dropped support for (see #51186 and #46887);

// 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].
defaultMinAPIVersion = "1.44"
// MinAPIVersion is the minimum API version supported by the daemon.
MinAPIVersion = "1.24"

This adds options to override the minimum API version considered
when performing API-version negotiation. These options allow the
client to either downgrade to versions lower than supported (lower
than MinAPIVersion), which may result in degraded functionality,
or to raise the minimum version to exclude older API versions.

The `WithMinAPIVersion` can be used to set the version programmatically.
The `WithMinAPIVersionFromEnv` allows a user to set the minimum API
version at runtime through the `DOCKER_MIN_API_VERSION` env-var.

The `WithMinAPIVersionFromEnv` is more permissive to account for
slightly malformed valus in the environment variables; it accepts
whitespace, and API versions with a "v" prefix. It also ignores
empty values in the environment-variable (which are considered a
no-op).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the client_min_api_version_override branch from 24b69e7 to 4d9a33a Compare February 17, 2026 09:19
@thaJeztah
Copy link
Member Author

On oracle (VM, rootless);

=== Failed
=== FAIL: amd64.docker.docker.integration.container TestContainerRestartWithCancelledRequest (3.65s)
    restart_test.go:283: timeout waiting for restart event

Windows (graphdriver, builtin);

=== Failed
=== FAIL: integration/container TestContainerRestartWithCancelledRequest (77.85s)
    restart_test.go:283: timeout waiting for restart event

Windows (graphdriver, containerd);

=== Failed
=== FAIL: integration/container TestWaitNonBlocked/wait-nonblocking-exit-0 (33.64s)
    wait_test.go:46: timeout hit after 30s: waiting for container State.Status to be 'exited', currently 'running'

@thaJeztah thaJeztah requested review from robmry and vvoland February 17, 2026 19:21
@vvoland vvoland removed this from the 29.3.0 milestone Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. module/client status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants