-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christopher Crone <[email protected]>
- Loading branch information
1 parent
61b13ba
commit 81f69a5
Showing
2 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// +build linux freebsd solaris openbsd | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/docker/docker/pkg/parsers/kernel" | ||
) | ||
|
||
// GetKernelVersion gets the current kernel version. | ||
func GetKernelVersion() *kernel.VersionInfo { | ||
v, _ := kernel.ParseRelease(testEnv.DaemonInfo.KernelVersion) | ||
return v | ||
} | ||
|
||
// CheckKernelVersion checks if current kernel is newer than (or equal to) | ||
// the given version. | ||
func CheckKernelVersion(k, major, minor int) bool { | ||
return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) > 0 | ||
} |