From 058b1946049e900dff4ffd8c0acf7b3a1b4af59b Mon Sep 17 00:00:00 2001 From: Kevin Pollet Date: Wed, 12 Nov 2025 16:32:06 +0100 Subject: [PATCH 1/2] Auto-negotiate Docker API version --- pkg/provider/docker/docker.go | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/pkg/provider/docker/docker.go b/pkg/provider/docker/docker.go index c0a49ca95..937fbb863 100644 --- a/pkg/provider/docker/docker.go +++ b/pkg/provider/docker/docker.go @@ -33,14 +33,6 @@ import ( "github.com/traefik/traefik/v2/pkg/version" ) -const ( - // DockerAPIVersion is a constant holding the version of the Provider API traefik will use. - DockerAPIVersion = "1.24" - - // SwarmAPIVersion is a constant holding the version of the Provider API traefik will use. - SwarmAPIVersion = "1.24" -) - // DefaultTemplateRule The default template for the default rule. const DefaultTemplateRule = "Host(`{{ normalize .Name }}`)" @@ -121,13 +113,10 @@ func (p *Provider) createClient() (client.APIClient, error) { httpHeaders := map[string]string{ "User-Agent": "Traefik " + version.Version, } - opts = append(opts, client.WithHTTPHeaders(httpHeaders)) - - apiVersion := DockerAPIVersion - if p.SwarmMode { - apiVersion = SwarmAPIVersion - } - opts = append(opts, client.WithVersion(apiVersion)) + opts = append(opts, + client.FromEnv, + client.WithAPIVersionNegotiation(), + client.WithHTTPHeaders(httpHeaders)) return client.NewClientWithOpts(opts...) } From 79bb320f4c8cc918b220589a5c44ffe232b23733 Mon Sep 17 00:00:00 2001 From: Kevin Pollet Date: Thu, 13 Nov 2025 10:42:16 +0100 Subject: [PATCH 2/2] Prepare release v2.11.31 --- CHANGELOG.md | 6 ++++++ script/gcg/traefik-bugfix.toml | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4d3b97b2..b4835f40d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [v2.11.31](https://github.com/traefik/traefik/tree/v2.11.31) (2025-11-13) +[All Commits](https://github.com/traefik/traefik/compare/v2.11.30...v2.11.31) + +**Bug fixes:** +- **[docker,docker/swarm]** Auto-negotiate Docker API version ([#12262](https://github.com/traefik/traefik/pull/12262) by [kevinpollet](https://github.com/kevinpollet)) + ## [v2.11.30](https://github.com/traefik/traefik/tree/v2.11.30) (2025-10-28) [All Commits](https://github.com/traefik/traefik/compare/v2.11.29...v2.11.30) diff --git a/script/gcg/traefik-bugfix.toml b/script/gcg/traefik-bugfix.toml index 28e2e85c8..50a57a14a 100644 --- a/script/gcg/traefik-bugfix.toml +++ b/script/gcg/traefik-bugfix.toml @@ -4,11 +4,11 @@ RepositoryName = "traefik" OutputType = "file" FileName = "traefik_changelog.md" -# example new bugfix v2.11.30 +# example new bugfix v2.11.31 CurrentRef = "v2.11" -PreviousRef = "v2.11.29" +PreviousRef = "v2.11.30" BaseBranch = "v2.11" -FutureCurrentRefName = "v2.11.30" +FutureCurrentRefName = "v2.11.31" ThresholdPreviousRef = 10 ThresholdCurrentRef = 10