mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
util: move kernel version functions to pkg/util/kernel
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
542ed3de63
commit
15da101b1b
@ -25,6 +25,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ceph/ceph-csi/pkg/util/kernel"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
|
||||
@ -71,7 +73,7 @@ var (
|
||||
hasNBD = true
|
||||
hasNBDCookieSupport = false
|
||||
|
||||
kernelCookieSupport = []util.KernelVersion{
|
||||
kernelCookieSupport = []kernel.KernelVersion{
|
||||
{
|
||||
Version: 5,
|
||||
PatchLevel: 14,
|
||||
@ -243,13 +245,13 @@ func SetRbdNbdToolFeatures() {
|
||||
log.DefaultLog("nbd module loaded")
|
||||
|
||||
// fetch the current running kernel info
|
||||
release, err := util.GetKernelVersion()
|
||||
release, err := kernel.GetKernelVersion()
|
||||
if err != nil {
|
||||
log.WarningLogMsg("fetching current kernel version failed (%v)", err)
|
||||
|
||||
return
|
||||
}
|
||||
if !util.CheckKernelSupport(release, kernelCookieSupport) {
|
||||
if !kernel.CheckKernelSupport(release, kernelCookieSupport) {
|
||||
log.WarningLogMsg("kernel version %q doesn't support cookie feature", release)
|
||||
|
||||
return
|
||||
|
Reference in New Issue
Block a user