mirror of
https://github.com/moby/moby.git
synced 2026-07-12 10:35:14 +00:00
The `Commit` type was introduced in2790ac68b3, to assist triaging issues that were reported with an incorrect version of runc or containerd. At the time, both `runc` and `containerd` were not yet stable, and had to be built from a specific commit to guarantee compatibility. We encountered various situations where unexpected (and incompatible) versions of those binaries were packaged, resulting in hard to trace bug-reports. For those situations, a "expected" version was set at compile time, to indicate if the version installed was different from the expected version; docker info ... runc version: a592beb5bc4c4092b1b1bac971afed27687340c5 (expected: 69663f0bd4b60df09991c08812a60108003fa340) Both `runc` and `containerd` are stable now, and docker 19.03 and up set the expected version to the actual version sincec65f0bd13cand 23.0 did the same for the `init` binaryb585c64e2b, to prevent the CLI from reporting "unexpected version". In short; the `Expected` fields no longer serves a real purpose. In future, we can even consider deprecating the `ContainerdCommit`, `RuncCommit` and `InitCommit` fields on the `/info` response (as we also include this information as part of the components returned in `/version`), but those can still be useful currently for situations where a user only provides `docker info` output. This patch starts with deprecating the `Expected` field. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
28 lines
987 B
Go
28 lines
987 B
Go
//go:build !windows
|
|
|
|
package system // import "github.com/docker/docker/integration/system"
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gotest.tools/v3/assert"
|
|
is "gotest.tools/v3/assert/cmp"
|
|
)
|
|
|
|
func TestInfoBinaryCommits(t *testing.T) {
|
|
ctx := setupTest(t)
|
|
apiClient := testEnv.APIClient()
|
|
|
|
info, err := apiClient.Info(ctx)
|
|
assert.NilError(t, err)
|
|
|
|
assert.Check(t, "N/A" != 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)) //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)) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.49.
|
|
}
|