From 9d4020d255b36affeceadb56fcac83b06316a4b3 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 7 Aug 2020 10:17:39 +0200 Subject: [PATCH] util: use local ErrorLog() for CheckKernelSupport() instead of klog Signed-off-by: Niels de Vos --- internal/util/util.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/util/util.go b/internal/util/util.go index c06c0f20c..b04565999 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -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 }