mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
81f69a5931
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
19 lines
560 B
Go
19 lines
560 B
Go
// +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
|
|
}
|