@@ -11,7 +11,6 @@ import (
1111
1212 "github.com/docker/docker/api/types"
1313 containertypes "github.com/docker/docker/api/types/container"
14- "github.com/docker/docker/dockerversion"
1514 "github.com/docker/docker/pkg/sysinfo"
1615 "github.com/pkg/errors"
1716 "github.com/sirupsen/logrus"
@@ -38,55 +37,44 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
3837 v .Runtimes = daemon .configStore .GetAllRuntimes ()
3938 v .DefaultRuntime = daemon .configStore .GetDefaultRuntimeName ()
4039 v .InitBinary = daemon .configStore .GetInitPath ()
40+ v .RuncCommit .ID = "N/A"
41+ v .ContainerdCommit .ID = "N/A"
42+ v .InitCommit .ID = "N/A"
4143
4244 defaultRuntimeBinary := daemon .configStore .GetRuntime (v .DefaultRuntime ).Path
4345 if rv , err := exec .Command (defaultRuntimeBinary , "--version" ).Output (); err == nil {
4446 if _ , _ , commit , err := parseRuntimeVersion (string (rv )); err != nil {
4547 logrus .Warnf ("failed to parse %s version: %v" , defaultRuntimeBinary , err )
46- v .RuncCommit .ID = "N/A"
4748 } else {
4849 v .RuncCommit .ID = commit
4950 }
5051 } else {
5152 logrus .Warnf ("failed to retrieve %s version: %v" , defaultRuntimeBinary , err )
52- v .RuncCommit .ID = "N/A"
5353 }
5454
55- // runc is now shipped as a separate package. Set "expected" to same value
56- // as "ID" to prevent clients from reporting a version-mismatch
57- v .RuncCommit .Expected = v .RuncCommit .ID
58-
5955 if rv , err := daemon .containerd .Version (context .Background ()); err == nil {
6056 v .ContainerdCommit .ID = rv .Revision
6157 } else {
6258 logrus .Warnf ("failed to retrieve containerd version: %v" , err )
63- v .ContainerdCommit .ID = "N/A"
6459 }
6560
66- // containerd is now shipped as a separate package. Set "expected" to same
67- // value as "ID" to prevent clients from reporting a version-mismatch
68- v .ContainerdCommit .Expected = v .ContainerdCommit .ID
69-
70- // TODO is there still a need to check the expected version for tini?
71- // if not, we can change this, and just set "Expected" to v.InitCommit.ID
72- v .InitCommit .Expected = dockerversion .InitCommitID
73-
7461 defaultInitBinary := daemon .configStore .GetInitPath ()
7562 if rv , err := exec .Command (defaultInitBinary , "--version" ).Output (); err == nil {
7663 if _ , commit , err := parseInitVersion (string (rv )); err != nil {
7764 logrus .Warnf ("failed to parse %s version: %s" , defaultInitBinary , err )
78- v .InitCommit .ID = "N/A"
7965 } else {
8066 v .InitCommit .ID = commit
81- if len (dockerversion .InitCommitID ) > len (commit ) {
82- v .InitCommit .Expected = dockerversion .InitCommitID [0 :len (commit )]
83- }
8467 }
8568 } else {
8669 logrus .Warnf ("failed to retrieve %s version: %s" , defaultInitBinary , err )
87- v .InitCommit .ID = "N/A"
8870 }
8971
72+ // Set expected and actual commits to the same value to prevent the client
73+ // showing that the version does not match the "expected" version/commit.
74+ v .RuncCommit .Expected = v .RuncCommit .ID
75+ v .ContainerdCommit .Expected = v .ContainerdCommit .ID
76+ v .InitCommit .Expected = v .InitCommit .ID
77+
9078 if v .CgroupDriver == cgroupNoneDriver {
9179 if v .CgroupVersion == "2" {
9280 v .Warnings = append (v .Warnings , "WARNING: Running in rootless-mode without cgroups. Systemd is required to enable cgroups in rootless-mode." )
0 commit comments