daemon: define default (and maximum) API version#50436
Conversation
| // DefaultAPIVersion is the highest REST API version supported by the daemon. | ||
| // | ||
| // This version may be lower than the [api.DefaultVersion], which is the default | ||
| // (and highest supported) version of the api library module used. | ||
| DefaultAPIVersion = "1.52" |
There was a problem hiding this comment.
Possibly these should be moved to the Server package and/or injected to it, but we can move later if we see fit.
There was a problem hiding this comment.
Perhaps we could move these into version.generated.go and then go generate them to avoid having to encode the version in multiple places?
There was a problem hiding this comment.
Yeah, I was considering having an integration tests to validate they're all the same versions (something that's testing how api + client + daemon integrate).
We have this code for the "version", which gets set at compile time, but for this one, we must commit the changes in source-control;
moby/dockerversion/version_lib.go
Lines 5 to 12 in b10cbd9
There was a problem hiding this comment.
If we'd go for go generate, we'd have to look where to put that code (i.e., we don't want someone using the client module to run go generate and it picking up the version from the api module 🤔
There was a problem hiding this comment.
IMO, go generate would just be a part of the "bump API version" action on the maintainer side.
There was a problem hiding this comment.
As discussed in the call; let's look at this in a follow-up.
(I agree it would be nice to have; the go generate can be used then to detect when versions are incorrect in CI)
With the daemon and API migrating to separate modules, users of the daemon module may upgrade the API module to higher versions. Currently, the daemon uses the API's Default version. While the version of the API module is allowed to be updated (following SemVer), we should not allow the Daemon to support higher API versions than it was written for. This patch introduces a DefaultAPIVersion in the daemon/config package that is used as default version of the API for the daemon to use. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
b2be2da to
a632b84
Compare
With the daemon and API migrating to separate modules, users of the daemon module may upgrade the API module to higher versions. Currently, the daemon uses the API's Default version. While the version of the API module is allowed to be updated (following SemVer), we should not allow the Daemon to support higher API versions than it was written for.
This patch introduces a DefaultAPIVersion in the daemon/config package that is used as default version of the API for the daemon to use.
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)