info: stop printing "Expected" commits

The `Commit` type was introduced in 2790ac68b3,
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 since c65f0bd13c
and 23.0 did the same for the `init` binary b585c64e2b,
to prevent the CLI from reporting "unexpected version".

In short; the `Expected` fields no longer serves a real purpose, so we should
no longer print it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-09-10 13:38:46 +02:00
parent a464a63d33
commit 88ca4e958f
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 15 deletions

View File

@ -273,21 +273,9 @@ func prettyPrintServerInfo(streams command.Streams, info *dockerInfo) []error {
if info.OSType == "linux" { if info.OSType == "linux" {
fprintln(output, " Init Binary:", info.InitBinary) fprintln(output, " Init Binary:", info.InitBinary)
fprintln(output, " containerd version:", info.ContainerdCommit.ID)
for _, ci := range []struct { fprintln(output, " runc version:", info.RuncCommit.ID)
Name string fprintln(output, " init version:", info.InitCommit.ID)
Commit system.Commit
}{
{"containerd", info.ContainerdCommit},
{"runc", info.RuncCommit},
{"init", info.InitCommit},
} {
fprintf(output, " %s version: %s", ci.Name, ci.Commit.ID)
if ci.Commit.ID != ci.Commit.Expected {
fprintf(output, " (expected: %s)", ci.Commit.Expected)
}
fprintln(output)
}
if len(info.SecurityOptions) != 0 { if len(info.SecurityOptions) != 0 {
if kvs, err := system.DecodeSecurityOptions(info.SecurityOptions); err != nil { if kvs, err := system.DecodeSecurityOptions(info.SecurityOptions); err != nil {
errs = append(errs, err) errs = append(errs, err)