util: use local ErrorLog() for CheckKernelSupport() instead of klog

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-08-07 10:17:39 +02:00 committed by mergify[bot]
parent 75ae16cfab
commit 9d4020d255

View File

@ -31,7 +31,6 @@ import (
"google.golang.org/grpc/status"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/cloud-provider/volume/helpers"
klog "k8s.io/klog/v2"
"k8s.io/utils/mount"
)
@ -174,12 +173,12 @@ func CheckKernelSupport(release string, supportedVersions []KernelVersion) bool
vers := strings.Split(strings.SplitN(release, "-", 2)[0], ".")
version, err := strconv.Atoi(vers[0])
if err != nil {
klog.Errorf("failed to parse version from %s: %v", release, err)
ErrorLog("failed to parse version from %s: %v", release, err)
return false
}
patchlevel, err := strconv.Atoi(vers[1])
if err != nil {
klog.Errorf("failed to parse patchlevel from %s: %v", release, err)
ErrorLog("failed to parse patchlevel from %s: %v", release, err)
return false
}
sublevel := 0
@ -187,7 +186,7 @@ func CheckKernelSupport(release string, supportedVersions []KernelVersion) bool
if len(vers) >= minLenForSublvl {
sublevel, err = strconv.Atoi(vers[2])
if err != nil {
klog.Errorf("failed to parse sublevel from %s: %v", release, err)
ErrorLog("failed to parse sublevel from %s: %v", release, err)
return false
}
}
@ -224,7 +223,7 @@ func CheckKernelSupport(release string, supportedVersions []KernelVersion) bool
}
}
}
klog.Errorf("kernel %s does not support required features", release)
ErrorLog("kernel %s does not support required features", release)
return false
}