Skip to content

client: deprecate old API versions#46962

Closed
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:client_min_api_version
Closed

client: deprecate old API versions#46962
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:client_min_api_version

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Dec 18, 2023

- What I did

- How I did it

- How to verify it

- Description for the changelog

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

@thaJeztah
Copy link
Copy Markdown
Member Author

Need to looks at how we set API versions in some tests; looks like we do so including a v prefix (which current validation doesn't accept)


[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === Failed
[2023-12-18T18:57:28.211Z] === FAIL: client TestGetAPIPath (0.00s)
[2023-12-18T18:57:28.211Z]     client_test.go:180: assertion failed: error is not nil: API version must be provided without "v" prefix
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestNegotiateAPIVersionEmpty (0.00s)
[2023-12-18T18:57:28.211Z]     client_test.go:272: assertion failed: 1.25 (string) != 1.24 (expected string)
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestNegotiateAPIVersion/downgrade_from_default (0.00s)
[2023-12-18T18:57:28.211Z]     client_test.go:338: assertion failed: 1.21 (tc.expectedVersion string) != 1.44 (string)
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestNegotiateAPIVersion/downgrade_legacy (0.00s)
[2023-12-18T18:57:28.211Z]     client_test.go:338: assertion failed: 1.24 (tc.expectedVersion string) != 1.44 (string)
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestNegotiateAPIVersion/downgrade_old (0.00s)
[2023-12-18T18:57:28.211Z]     client_test.go:338: assertion failed: 1.19 (tc.expectedVersion string) != 1.44 (string)
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestNegotiateAPIVersion (0.00s)
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestNegotiateAPVersionOverride (0.00s)
[2023-12-18T18:57:28.211Z]     client_test.go:350: assertion failed: error is not nil: maximum supported API version is 1.44: 9.99
[2023-12-18T18:57:28.211Z] 
[2023-12-18T18:57:28.211Z] === FAIL: client TestOptionWithVersionFromEnv (0.00s)
[2023-12-18T18:57:28.211Z]     options_test.go:59: assertion failed: error is not nil: maximum supported API version is 1.44: 2.9999

@thaJeztah thaJeztah force-pushed the client_min_api_version branch 4 times, most recently from 562b552 to 77ba204 Compare December 18, 2023 20:27
@thaJeztah
Copy link
Copy Markdown
Member Author

Ah! 🤦 I forgot that DOCKER_API_VERSION (by "design") should accept "anything", including completely bogus versions;


[2023-12-18T20:29:28.187Z] === FAIL: client TestNegotiateAPVersionOverride (0.00s)
[2023-12-18T20:29:28.187Z]     client_test.go:360: assertion failed: error is not nil: maximum supported API version is 1.44: 9.99
[2023-12-18T20:29:28.187Z] 
[2023-12-18T20:29:28.187Z] === FAIL: client TestOptionWithVersionFromEnv (0.00s)
[2023-12-18T20:29:28.187Z]     options_test.go:59: assertion failed: error is not nil: maximum supported API version is 1.44: 2.9999

I guess (for now) I need to keep that behavior

Copy link
Copy Markdown
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

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

Could this wait until after we migrate moby/moby to Go Modules? We'd then be able to drop support for old API versions and remove code without deprecation periods, environment variables(!!!) or putting downstream users through dependency hell.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

@thaJeztah thaJeztah closed this Feb 15, 2026
@thaJeztah thaJeztah deleted the client_min_api_version branch February 15, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants