René's URL Explorer Experiment


Title: feat: opt-in API version auto-negotiation by postalservice14 · Pull Request #2630 · docker-java/docker-java · GitHub

Open Graph Title: feat: opt-in API version auto-negotiation by postalservice14 · Pull Request #2630 · docker-java/docker-java

X Title: feat: opt-in API version auto-negotiation by postalservice14 · Pull Request #2630 · docker-java/docker-java

Description: Summary Adds an opt-in API version auto-negotiation flag, similar to moby/client.NegotiateAPIVersion. When enabled, the client queries GET /version once at construction and pins itself to min(daemon ApiVersion, latest version supported by docker-java). If that result is below the daemon's MinAPIVersion, the daemon's minimum is used and a WARN is logged. Fixes #2547. Behaviour Default off. Existing callers see no behaviour change. Opt-in surface: DefaultDockerClientConfig.Builder.withApiVersionAutoNegotiation(boolean), env var DOCKER_API_VERSION_AUTO_NEGOTIATION, property api.version.auto.negotiation (truthy values: true case-insensitive, 1). Precedence: explicit withApiVersion(...) always wins. If both are set, the explicit version is used and negotiation is skipped. Failure mode: a non-2xx /version response or transport exception throws DockerClientException — the caller opted in, so loud failure is the right call. Implementation DockerClientConfig gets a new default boolean isApiVersionAutoNegotiationEnabled() { return false; }. The project's japicmp config already tolerates METHOD_NEW_DEFAULT, so this is binary-compatible against the 3.3.4 baseline. ApiVersionNegotiator is a new public utility class that calls GET /version directly via DockerHttpClient and applies the moby negotiation formula. It deliberately does not reuse VersionCmdExec to avoid a circular dependency with the cmd-exec factory that's still being constructed. NegotiatedDockerClientConfig is a package-private decorator that overrides only getApiVersion(), so DefaultDockerClientConfig stays immutable. The negotiation hook runs inside DockerClientImpl.getInstance(DockerClientConfig, DockerHttpClient), before the cmd-exec factory is built, so every subsequent command picks up the negotiated version. The client's "latest supported version" is discovered by reflection over RemoteApiVersion's VERSION_1_X constants — adding new constants in future bumps just works without touching the negotiator. Test plan ./mvnw -pl docker-java -am test -Dtest='ApiVersionNegotiatorTest,DefaultDockerClientConfigTest' — 30 tests, all green ./mvnw clean install -DskipITs — full reactor build, japicmp clean on docker-java-api + every transport adapter, Checkstyle clean across all modules Negotiator covers: daemon newer than client (pins to client max), daemon older than client (pins to daemon), daemon min above client max (pins to daemon min, warns), non-2xx and missing-ApiVersion failure paths Config covers: builder default-off, builder boolean setter, string parser parity with withDockerTlsVerify, env-var path, system-property path Note: OkHttpClientTests#testHijacking is flaky on my dev machine — failing identically on this branch and on main — but it's untouched by this PR. Out of scope Flipping the default to on (a future PR can do that once this one has shipped). Re-running negotiation after a daemon restart / reconnect. The current behaviour is one-shot at construction, matching moby's NegotiateAPIVersion. This change is 

Open Graph Description: Summary Adds an opt-in API version auto-negotiation flag, similar to moby/client.NegotiateAPIVersion. When enabled, the client queries GET /version once at construction and pins itself to min(daemo...

X Description: Summary Adds an opt-in API version auto-negotiation flag, similar to moby/client.NegotiateAPIVersion. When enabled, the client queries GET /version once at construction and pins itself to min(daemo...

Opengraph URL: https://github.com/docker-java/docker-java/pull/2630

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ff3955d8-d315-dd71-5e95-30ff01dbc544
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD870:13D32C:6B6F69:919A67:6A51D1EA
html-safe-nonce0492994eeca1eee81b920e5dbe6800e378bcd1f80037c7d0012c7749ec4d36e6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODcwOjEzRDMyQzo2QjZGNjk6OTE5QTY3OjZBNTFEMUVBIiwidmlzaXRvcl9pZCI6IjMxMzk0NTEyNDYzODMwNTk0MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac821e2db4d54c97c57426789661d768eb27e5adb584a345786da441172cd66a9c
hovercard-subject-tagpull_request:3718815225
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/docker-java/docker-java/pull/2630/files
twitter:imagehttps://avatars.githubusercontent.com/u/46067?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/46067?s=400&v=4
og:image:altSummary Adds an opt-in API version auto-negotiation flag, similar to moby/client.NegotiateAPIVersion. When enabled, the client queries GET /version once at construction and pins itself to min(daemo...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git
octolytics-dimension-user_id7772003
octolytics-dimension-user_logindocker-java
octolytics-dimension-repository_id20415251
octolytics-dimension-repository_nwodocker-java/docker-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20415251
octolytics-dimension-repository_network_root_nwodocker-java/docker-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/docker-java/docker-java/pull/2630/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdocker-java%2Fdocker-java%2Fpull%2F2630%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdocker-java%2Fdocker-java%2Fpull%2F2630%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=docker-java%2Fdocker-java
Reloadhttps://github.com/docker-java/docker-java/pull/2630/files
Reloadhttps://github.com/docker-java/docker-java/pull/2630/files
Reloadhttps://github.com/docker-java/docker-java/pull/2630/files
Please reload this pagehttps://github.com/docker-java/docker-java/pull/2630/files
docker-java https://github.com/docker-java
docker-javahttps://github.com/docker-java/docker-java
Notifications https://github.com/login?return_to=%2Fdocker-java%2Fdocker-java
Fork 1.1k https://github.com/login?return_to=%2Fdocker-java%2Fdocker-java
Star 3.2k https://github.com/login?return_to=%2Fdocker-java%2Fdocker-java
Code https://github.com/docker-java/docker-java
Issues 38 https://github.com/docker-java/docker-java/issues
Pull requests 57 https://github.com/docker-java/docker-java/pulls
Discussions https://github.com/docker-java/docker-java/discussions
Actions https://github.com/docker-java/docker-java/actions
Projects https://github.com/docker-java/docker-java/projects
Security and quality 0 https://github.com/docker-java/docker-java/security
Insights https://github.com/docker-java/docker-java/pulse
Code https://github.com/docker-java/docker-java
Issues https://github.com/docker-java/docker-java/issues
Pull requests https://github.com/docker-java/docker-java/pulls
Discussions https://github.com/docker-java/docker-java/discussions
Actions https://github.com/docker-java/docker-java/actions
Projects https://github.com/docker-java/docker-java/projects
Security and quality https://github.com/docker-java/docker-java/security
Insights https://github.com/docker-java/docker-java/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fdocker-java%2Fdocker-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fdocker-java%2Fdocker-java%2Fissues%2Fnew%2Fchoose
postalservice14https://github.com/postalservice14
docker-java:mainhttps://github.com/docker-java/docker-java/tree/main
postalservice14:fix/2547-api-version-auto-negotiationhttps://github.com/postalservice14/docker-java/tree/fix/2547-api-version-auto-negotiation
Conversation 0 https://github.com/docker-java/docker-java/pull/2630
Commits 2 https://github.com/docker-java/docker-java/pull/2630/commits
Checks 4 https://github.com/docker-java/docker-java/pull/2630/checks
Files changed https://github.com/docker-java/docker-java/pull/2630/files
Please reload this pagehttps://github.com/docker-java/docker-java/pull/2630/files
feat: opt-in API version auto-negotiation https://github.com/docker-java/docker-java/pull/2630/files#top
Show all changes 2 commits https://github.com/docker-java/docker-java/pull/2630/files
d00b736 feat: opt-in API version auto-negotiation postalservice14 May 20, 2026 https://github.com/docker-java/docker-java/pull/2630/commits/d00b73692b59603ac9f1ba2fa7c8bb794ff4840e
19f529b docs: document API version auto-negotiation flag postalservice14 May 20, 2026 https://github.com/docker-java/docker-java/pull/2630/commits/19f529b1e0d323966f38499cd3144c8a66fc9ed3
Clear filters https://github.com/docker-java/docker-java/pull/2630/files
Please reload this pagehttps://github.com/docker-java/docker-java/pull/2630/files
Please reload this pagehttps://github.com/docker-java/docker-java/pull/2630/files
ApiVersionNegotiator.java https://github.com/docker-java/docker-java/pull/2630/files#diff-7abc0888bc62d9b400060900bddc5c89f285c9c555320189f82c5a4138f88814
DefaultDockerClientConfig.java https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
DockerClientConfig.java https://github.com/docker-java/docker-java/pull/2630/files#diff-9d77442f10bd7f4e34ed3b87c4bcfe5d82c46d0db6b2ec76df3b12c23313a892
DockerClientImpl.java https://github.com/docker-java/docker-java/pull/2630/files#diff-875c58cbff57d514521bc92899921dbd778fe1dbd5e546bda57c9a2302ed8dd2
NegotiatedDockerClientConfig.java https://github.com/docker-java/docker-java/pull/2630/files#diff-a43fc22fbe80f7be851e494f1770fdd30b57287b1b62043fa940d414f6cffd87
ApiVersionNegotiatorTest.java https://github.com/docker-java/docker-java/pull/2630/files#diff-0f1bc98a71514593d13df37cb7186d72c3d5e963a15e6522cf919d7c652b8463
DefaultDockerClientConfigTest.java https://github.com/docker-java/docker-java/pull/2630/files#diff-924d24a94496a7c7ad0e737cf59be1cce5b9ad36672f914b44e38a66b4c376e5
getting_started.md https://github.com/docker-java/docker-java/pull/2630/files#diff-7627439dcd69d95a42bb123ac4cfb7682f86da5d6aee037206d9857459906243
https://github.com/docker-java/docker-java/blob/main/.github/CODEOWNERS#L1
docker-java-core/src/main/java/com/github/dockerjava/core/ApiVersionNegotiator.javahttps://github.com/docker-java/docker-java/pull/2630/files#diff-7abc0888bc62d9b400060900bddc5c89f285c9c555320189f82c5a4138f88814
View file https://github.com/docker-java/docker-java/blob/19f529b1e0d323966f38499cd3144c8a66fc9ed3/docker-java-core/src/main/java/com/github/dockerjava/core/ApiVersionNegotiator.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/docker-java/docker-java/pull/2630/{{ revealButtonHref }}
https://github.com/docker-java/docker-java/blob/main/.github/CODEOWNERS#L1
docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.javahttps://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
View file https://github.com/docker-java/docker-java/blob/19f529b1e0d323966f38499cd3144c8a66fc9ed3/docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/docker-java/docker-java/pull/2630/{{ revealButtonHref }}
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/pull/2630/files#diff-41d651bc69ac2927e94a228c81b40f689f44776284459cbba46a8f35ed331d21
https://github.com/docker-java/docker-java/blob/main/.github/CODEOWNERS#L1
docker-java-core/src/main/java/com/github/dockerjava/core/DockerClientConfig.javahttps://github.com/docker-java/docker-java/pull/2630/files#diff-9d77442f10bd7f4e34ed3b87c4bcfe5d82c46d0db6b2ec76df3b12c23313a892
View file https://github.com/docker-java/docker-java/blob/19f529b1e0d323966f38499cd3144c8a66fc9ed3/docker-java-core/src/main/java/com/github/dockerjava/core/DockerClientConfig.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/docker-java/docker-java/pull/2630/{{ revealButtonHref }}
https://github.com/docker-java/docker-java/pull/2630/files#diff-9d77442f10bd7f4e34ed3b87c4bcfe5d82c46d0db6b2ec76df3b12c23313a892
https://github.com/docker-java/docker-java/pull/2630/files#diff-9d77442f10bd7f4e34ed3b87c4bcfe5d82c46d0db6b2ec76df3b12c23313a892
https://github.com/docker-java/docker-java/blob/main/.github/CODEOWNERS#L1
docker-java-core/src/main/java/com/github/dockerjava/core/DockerClientImpl.javahttps://github.com/docker-java/docker-java/pull/2630/files#diff-875c58cbff57d514521bc92899921dbd778fe1dbd5e546bda57c9a2302ed8dd2
View file https://github.com/docker-java/docker-java/blob/19f529b1e0d323966f38499cd3144c8a66fc9ed3/docker-java-core/src/main/java/com/github/dockerjava/core/DockerClientImpl.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/docker-java/docker-java/pull/2630/{{ revealButtonHref }}
https://github.com/docker-java/docker-java/pull/2630/files#diff-875c58cbff57d514521bc92899921dbd778fe1dbd5e546bda57c9a2302ed8dd2
https://github.com/docker-java/docker-java/pull/2630/files#diff-875c58cbff57d514521bc92899921dbd778fe1dbd5e546bda57c9a2302ed8dd2
Please reload this pagehttps://github.com/docker-java/docker-java/pull/2630/files
Please reload this pagehttps://github.com/docker-java/docker-java/pull/2630/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.