Skip to content

Commit b585c64

Browse files
committed
info: remove "expected" check for tini version
These checks were added when we required a specific version of containerd and runc (different versions were known to be incompatible). I don't think we had a similar requirement for tini, so this check was redundant. Let's remove the check altogether. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 2f74fa5 commit b585c64

3 files changed

Lines changed: 9 additions & 23 deletions

File tree

daemon/info_unix.go

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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.")

dockerversion/version_lib.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var (
1010
Version = "library-import"
1111
BuildTime = "library-import"
1212
IAmStatic = "library-import"
13-
InitCommitID = "library-import"
1413
PlatformName = ""
1514
ProductName = ""
1615
DefaultProductLicense = ""

hack/make/.go-autogen

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ LDFLAGS="${LDFLAGS} \
1414
-X \"github.com/docker/docker/dockerversion.PlatformName=${PLATFORM}\" \
1515
-X \"github.com/docker/docker/dockerversion.ProductName=${PRODUCT}\" \
1616
-X \"github.com/docker/docker/dockerversion.DefaultProductLicense=${DEFAULT_PRODUCT_LICENSE}\" \
17-
-X \"github.com/docker/docker/dockerversion.InitCommitID=${TINI_COMMIT}\" \
1817
"
1918

2019
# Compile the Windows resources into the sources

0 commit comments

Comments
 (0)