Skip to content

Commit c65f0bd

Browse files
committed
Remove version-checks for containerd and runc
With containerd reaching 1.0, the runtime now has a stable API, so there's no need to do a check if the installed version matches the expected version. Current versions of Docker now also package containerd and runc separately, and can be _updated_ separately. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 71d1cc3 commit c65f0bd

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

daemon/info_unix.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
2929
v.DefaultRuntime = daemon.configStore.GetDefaultRuntimeName()
3030
v.InitBinary = daemon.configStore.GetInitPath()
3131

32-
v.RuncCommit.Expected = dockerversion.RuncCommitID
3332
defaultRuntimeBinary := daemon.configStore.GetRuntime(v.DefaultRuntime).Path
3433
if rv, err := exec.Command(defaultRuntimeBinary, "--version").Output(); err == nil {
3534
parts := strings.Split(strings.TrimSpace(string(rv)), "\n")
@@ -49,14 +48,21 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
4948
v.RuncCommit.ID = "N/A"
5049
}
5150

52-
v.ContainerdCommit.Expected = dockerversion.ContainerdCommitID
51+
// runc is now shipped as a separate package. Set "expected" to same value
52+
// as "ID" to prevent clients from reporting a version-mismatch
53+
v.RuncCommit.Expected = v.RuncCommit.ID
54+
5355
if rv, err := daemon.containerd.Version(context.Background()); err == nil {
5456
v.ContainerdCommit.ID = rv.Revision
5557
} else {
5658
logrus.Warnf("failed to retrieve containerd version: %v", err)
5759
v.ContainerdCommit.ID = "N/A"
5860
}
5961

62+
// containerd is now shipped as a separate package. Set "expected" to same
63+
// value as "ID" to prevent clients from reporting a version-mismatch
64+
v.ContainerdCommit.Expected = v.ContainerdCommit.ID
65+
6066
defaultInitBinary := daemon.configStore.GetInitPath()
6167
if rv, err := exec.Command(defaultInitBinary, "--version").Output(); err == nil {
6268
ver, err := parseInitVersion(string(rv))

dockerversion/version_lib.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ const (
1010
Version = "library-import"
1111
BuildTime = "library-import"
1212
IAmStatic = "library-import"
13-
ContainerdCommitID = "library-import"
14-
RuncCommitID = "library-import"
1513
InitCommitID = "library-import"
1614
PlatformName = ""
1715
ProductName = ""

hack/make/.go-autogen

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const (
1919
Version string = "$VERSION"
2020
BuildTime string = "$BUILDTIME"
2121
IAmStatic string = "${IAMSTATIC:-true}"
22-
ContainerdCommitID string = "${CONTAINERD_COMMIT}"
2322
PlatformName string = "${PLATFORM}"
2423
ProductName string = "${PRODUCT}"
2524
DefaultProductLicense string = "${DEFAULT_PRODUCT_LICENSE}"
@@ -37,7 +36,6 @@ package dockerversion
3736
// Default build-time variable for library-import.
3837
// This file is overridden on build with build-time information.
3938
const (
40-
RuncCommitID string = "${RUNC_COMMIT}"
4139
InitCommitID string = "${TINI_COMMIT}"
4240
)
4341

0 commit comments

Comments
 (0)