diff --git a/api/server/router/system/system_routes.go b/api/server/router/system/system_routes.go index fa73169bac90b..db98566a0176c 100644 --- a/api/server/router/system/system_routes.go +++ b/api/server/router/system/system_routes.go @@ -100,6 +100,12 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht // Containerd field introduced in API v1.46. info.Containerd = nil } + + // TODO(thaJeztah): Expected commits are deprecated, and should no longer be set in API 1.49. + info.ContainerdCommit.Expected = info.ContainerdCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. + info.RuncCommit.Expected = info.RuncCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. + info.InitCommit.Expected = info.InitCommit.ID //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. + if versions.GreaterThanOrEqualTo(version, "1.42") { info.KernelMemory = false } diff --git a/api/swagger.yaml b/api/swagger.yaml index d7c438dbca3b9..974fbf12e2d60 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -6170,6 +6170,8 @@ definitions: Expected: description: | Commit ID of external tool expected by dockerd as set at build time. + + **Deprecated**: This field is deprecated and will be omitted in a API v1.49. type: "string" example: "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" diff --git a/api/types/system/info.go b/api/types/system/info.go index c66a2afb8bbe3..4704edfba7314 100644 --- a/api/types/system/info.go +++ b/api/types/system/info.go @@ -137,8 +137,13 @@ type PluginsInfo struct { // Commit holds the Git-commit (SHA1) that a binary was built from, as reported // in the version-string of external tools, such as containerd, or runC. type Commit struct { - ID string // ID is the actual commit ID of external tool. - Expected string // Expected is the commit ID of external tool expected by dockerd as set at build time. + // ID is the actual commit ID or version of external tool. + ID string + + // Expected is the commit ID of external tool expected by dockerd as set at build time. + // + // Deprecated: this field is no longer used in API v1.49, but kept for backward-compatibility with older API versions. + Expected string } // NetworkAddressPool is a temp struct used by [Info] struct. diff --git a/daemon/info_unix.go b/daemon/info_unix.go index c5abc39709fa4..3e52fa9f3f346 100644 --- a/daemon/info_unix.go +++ b/daemon/info_unix.go @@ -196,7 +196,6 @@ func populateRuncCommit(v *system.Commit, cfg *configStore) error { return err } v.ID = commit - v.Expected = commit return nil } @@ -223,7 +222,6 @@ func (daemon *Daemon) populateInitCommit(ctx context.Context, v *system.Info, cf return nil } v.InitCommit.ID = commit - v.InitCommit.Expected = v.InitCommit.ID return nil } @@ -437,7 +435,6 @@ func (daemon *Daemon) populateContainerdCommit(ctx context.Context, v *system.Co return nil } v.ID = rv.Revision - v.Expected = rv.Revision return nil } diff --git a/docs/api/version-history.md b/docs/api/version-history.md index 5053b9dd4ea31..5ab9370b34912 100644 --- a/docs/api/version-history.md +++ b/docs/api/version-history.md @@ -24,6 +24,9 @@ keywords: "API, Docker, rcli, REST, documentation" `platform` parameter (JSON encoded OCI Platform type) that allows to specify a platform to load/save. Not passing this parameter will result in loading/saving the full multi-platform image. +* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and + `InitCommit.Expected` fields in the `GET /info` endpoint are deprecated + and will be omitted in API v1.49. ## v1.47 API changes diff --git a/integration/system/info_linux_test.go b/integration/system/info_linux_test.go index 17313b30ca374..89050882036e0 100644 --- a/integration/system/info_linux_test.go +++ b/integration/system/info_linux_test.go @@ -17,11 +17,11 @@ func TestInfoBinaryCommits(t *testing.T) { assert.NilError(t, err) assert.Check(t, "N/A" != info.ContainerdCommit.ID) - assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID)) + assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. assert.Check(t, "N/A" != info.InitCommit.ID) - assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID)) + assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. assert.Check(t, "N/A" != info.RuncCommit.ID) - assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID)) + assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49. }