Browse code

Fix Windows build

Signed-off-by: Christopher Crone <christopher.crone@docker.com>

Christopher Crone authored on 2017/09/13 21:49:32
Showing 2 changed files
... ...
@@ -7,7 +7,6 @@ import (
7 7
 	"path/filepath"
8 8
 	"strings"
9 9
 
10
-	"github.com/docker/docker/pkg/parsers/kernel"
11 10
 	"github.com/docker/docker/pkg/stringutils"
12 11
 	"github.com/go-check/check"
13 12
 	"github.com/gotestyourself/gotestyourself/icmd"
... ...
@@ -182,15 +181,3 @@ func RemoveOutputForExistingElements(output string, existing []string) string {
182 182
 	res := RemoveLinesForExistingElements(strings.Split(output, "\n"), existing)
183 183
 	return strings.Join(res, "\n")
184 184
 }
185
-
186
-// GetKernelVersion gets the current kernel version.
187
-func GetKernelVersion() *kernel.VersionInfo {
188
-	v, _ := kernel.ParseRelease(testEnv.DaemonInfo.KernelVersion)
189
-	return v
190
-}
191
-
192
-// CheckKernelVersion checks if current kernel is newer than (or equal to)
193
-// the given version.
194
-func CheckKernelVersion(k, major, minor int) bool {
195
-	return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) > 0
196
-}
197 185
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+// +build linux freebsd solaris openbsd
1
+
2
+package main
3
+
4
+import (
5
+	"github.com/docker/docker/pkg/parsers/kernel"
6
+)
7
+
8
+// GetKernelVersion gets the current kernel version.
9
+func GetKernelVersion() *kernel.VersionInfo {
10
+	v, _ := kernel.ParseRelease(testEnv.DaemonInfo.KernelVersion)
11
+	return v
12
+}
13
+
14
+// CheckKernelVersion checks if current kernel is newer than (or equal to)
15
+// the given version.
16
+func CheckKernelVersion(k, major, minor int) bool {
17
+	return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) > 0
18
+}