Browse code

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>

Sebastiaan van Stijn authored on 2018/10/05 06:17:13
Showing 3 changed files
... ...
@@ -29,7 +29,6 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
29 29
 	v.DefaultRuntime = daemon.configStore.GetDefaultRuntimeName()
30 30
 	v.InitBinary = daemon.configStore.GetInitPath()
31 31
 
32
-	v.RuncCommit.Expected = dockerversion.RuncCommitID
33 32
 	defaultRuntimeBinary := daemon.configStore.GetRuntime(v.DefaultRuntime).Path
34 33
 	if rv, err := exec.Command(defaultRuntimeBinary, "--version").Output(); err == nil {
35 34
 		parts := strings.Split(strings.TrimSpace(string(rv)), "\n")
... ...
@@ -49,7 +48,10 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
49 49
 		v.RuncCommit.ID = "N/A"
50 50
 	}
51 51
 
52
-	v.ContainerdCommit.Expected = dockerversion.ContainerdCommitID
52
+	// runc is now shipped as a separate package. Set "expected" to same value
53
+	// as "ID" to prevent clients from reporting a version-mismatch
54
+	v.RuncCommit.Expected = v.RuncCommit.ID
55
+
53 56
 	if rv, err := daemon.containerd.Version(context.Background()); err == nil {
54 57
 		v.ContainerdCommit.ID = rv.Revision
55 58
 	} else {
... ...
@@ -57,6 +59,10 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
57 57
 		v.ContainerdCommit.ID = "N/A"
58 58
 	}
59 59
 
60
+	// containerd is now shipped as a separate package. Set "expected" to same
61
+	// value as "ID" to prevent clients from reporting a version-mismatch
62
+	v.ContainerdCommit.Expected = v.ContainerdCommit.ID
63
+
60 64
 	defaultInitBinary := daemon.configStore.GetInitPath()
61 65
 	if rv, err := exec.Command(defaultInitBinary, "--version").Output(); err == nil {
62 66
 		ver, err := parseInitVersion(string(rv))
... ...
@@ -10,8 +10,6 @@ const (
10 10
 	Version               = "library-import"
11 11
 	BuildTime             = "library-import"
12 12
 	IAmStatic             = "library-import"
13
-	ContainerdCommitID    = "library-import"
14
-	RuncCommitID          = "library-import"
15 13
 	InitCommitID          = "library-import"
16 14
 	PlatformName          = ""
17 15
 	ProductName           = ""
... ...
@@ -19,7 +19,6 @@ const (
19 19
 	Version               string = "$VERSION"
20 20
 	BuildTime             string = "$BUILDTIME"
21 21
 	IAmStatic             string = "${IAMSTATIC:-true}"
22
-	ContainerdCommitID    string = "${CONTAINERD_COMMIT}"
23 22
 	PlatformName          string = "${PLATFORM}"
24 23
 	ProductName           string = "${PRODUCT}"
25 24
 	DefaultProductLicense string = "${DEFAULT_PRODUCT_LICENSE}"
... ...
@@ -37,7 +36,6 @@ package dockerversion
37 37
 // Default build-time variable for library-import.
38 38
 // This file is overridden on build with build-time information.
39 39
 const (
40
-	RuncCommitID string = "${RUNC_COMMIT}"
41 40
 	InitCommitID string = "${TINI_COMMIT}"
42 41
 )
43 42