Skip to content
Permalink
Browse files

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 <github@gone.nl>
  • Loading branch information...
thaJeztah committed Oct 4, 2018
1 parent 71d1cc3 commit c65f0bd13c85d29087419fa555281311091825e7
Showing with 8 additions and 6 deletions.
  1. +8 −2 daemon/info_unix.go
  2. +0 −2 dockerversion/version_lib.go
  3. +0 −2 hack/make/.go-autogen
@@ -29,7 +29,6 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
v.DefaultRuntime = daemon.configStore.GetDefaultRuntimeName()
v.InitBinary = daemon.configStore.GetInitPath()

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

v.ContainerdCommit.Expected = dockerversion.ContainerdCommitID
// runc is now shipped as a separate package. Set "expected" to same value
// as "ID" to prevent clients from reporting a version-mismatch
v.RuncCommit.Expected = v.RuncCommit.ID

if rv, err := daemon.containerd.Version(context.Background()); err == nil {
v.ContainerdCommit.ID = rv.Revision
} else {
logrus.Warnf("failed to retrieve containerd version: %v", err)
v.ContainerdCommit.ID = "N/A"
}

// containerd is now shipped as a separate package. Set "expected" to same
// value as "ID" to prevent clients from reporting a version-mismatch
v.ContainerdCommit.Expected = v.ContainerdCommit.ID

defaultInitBinary := daemon.configStore.GetInitPath()
if rv, err := exec.Command(defaultInitBinary, "--version").Output(); err == nil {
ver, err := parseInitVersion(string(rv))
@@ -10,8 +10,6 @@ const (
Version = "library-import"
BuildTime = "library-import"
IAmStatic = "library-import"
ContainerdCommitID = "library-import"
RuncCommitID = "library-import"
InitCommitID = "library-import"
PlatformName = ""
ProductName = ""
@@ -19,7 +19,6 @@ const (
Version string = "$VERSION"
BuildTime string = "$BUILDTIME"
IAmStatic string = "${IAMSTATIC:-true}"
ContainerdCommitID string = "${CONTAINERD_COMMIT}"
PlatformName string = "${PLATFORM}"
ProductName string = "${PRODUCT}"
DefaultProductLicense string = "${DEFAULT_PRODUCT_LICENSE}"
@@ -37,7 +36,6 @@ package dockerversion
// Default build-time variable for library-import.
// This file is overridden on build with build-time information.
const (
RuncCommitID string = "${RUNC_COMMIT}"
InitCommitID string = "${TINI_COMMIT}"
)

0 comments on commit c65f0bd

Please sign in to comment.
You can’t perform that action at this time.