8000 api: remove unused DefaultVersion, MinSupportedAPIVersion consts by thaJeztah · Pull Request #50587 · moby/moby · GitHub
[go: up one dir, main page]

Skip to content

Conversation

thaJeztah
Copy link
Member
@thaJeztah thaJeztah commented Jul 31, 2025

These consts are no longer used, and separate consts were added in both the client and daemon packages;

- Human readable description for the release notes

api: remove unused `DefaultVersion`, `MinSupportedAPIVersion` consts

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

@thaJeztah
Copy link
Member Author

oh, derp, it's used in tests - fixing

@thaJeztah thaJeztah marked this pull request as draft July 31, 2025 21:14
@thaJeztah thaJeztah force-pushed the remove_version_consts branch 2 times, most recently from 0ed4f6a to c459932 Compare July 31, 2025 21:30
Comment on lines -59 to +58
// DefaultAPIVersion is the highest REST API version supported by the daemon.
// MaxAPIVersion is the highest REST API version supported by the daemon.
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, perhaps we should merge these into dockerversion and move that to daemon/version. We could even make that possible to override at build time through -X options (as we do for those other values); I don't think that's possible for const though, so technically they could be overridden at runtime, which may not be ideal.

// Default build-time variable for library-import.
// These variables are overridden on build with build-time information.
var (
GitCommit = "library-import"
Version = "library-import"
BuildTime = "library-import"
PlatformName = ""
ProductName = ""
DefaultProductLicense = ""
)

cc @dmcgowan @corhere WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it would make much sense to afford overriding the max API version at build time as that is a property of the daemon implementation. Increasing it would be a bug and I can't imagine a use for decreasing it. I'm not worried about overriding the values at runtime as nobody is supposed to be importing the daemon as a library anyway.

I agree that daemon/config is a strange place for constant metadata about the daemon's capabilities. I also agree with moving the dockerversion package to somewhere under daemon. (🚲 Thoughts on instead naming the package something like daemon/meta so the Version constants don't stutter?) But I don't think it's the right place for the API version-range metadata.

I think move the APIVersion constants make the most sense under the daemon/server package.

@thaJeztah thaJeztah marked this pull request as ready for review July 31, 2025 21:38
@thaJeztah thaJeztah force-pushed the remove_version_consts branch from c459932 to e03a85e Compare July 31, 2025 21:56
@thaJeztah thaJeztah closed this Jul 31, 2025
@thaJeztah thaJeztah reopened this Jul 31, 2025
@thaJeztah thaJeztah added the release-blocker PRs we want to block a release on label Aug 6, 2025
Copy link
Member
@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM after rebase

@dmcgowan dmcgowan added the kind/refactor PR's that refactor, or clean-up code label Sep 2, 2025
These consts are no longer used, and separate consts were added in both
the client and daemon packages;

- client: 41da570
- daemon: a632b84

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Contributor
@austinvazquez austinvazquez left a comment

Choose a reason for hiding this comment

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

Rebased to resolve minor conflicts in client. Changes LGTM.

@austinvazquez austinvazquez merged commit 5f8fd1f into moby:master Sep 4, 2025
208 of 209 checks passed
@vvoland vvoland added impact/go-sdk Noteworthy (compatibility changes) in the Go SDK area/go-sdk and removed area/api API labels Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/go-sdk impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0