From bf31a4d4199f36bde67bf501273befe0ca1253ef Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Mon, 29 May 2023 03:12:01 +0530 Subject: [PATCH] feat(deps): update k8s.io.klog (#63) Signed-off-by: Niladri Halder --- cmd/main.go | 7 ++++--- go.mod | 3 +-- go.sum | 2 -- pkg/collector/collector.go | 5 +++-- pkg/device/device-util.go | 2 +- pkg/device/mount.go | 5 +++-- pkg/device/volume.go | 2 +- pkg/driver/agent.go | 7 ++++--- pkg/driver/controller.go | 2 +- pkg/driver/driver.go | 5 +++-- pkg/driver/grpc.go | 2 +- pkg/driver/schd_helper.go | 3 ++- pkg/mgmt/devicenode/builder.go | 2 +- pkg/mgmt/devicenode/devicenode.go | 2 +- pkg/mgmt/volume/builder.go | 2 +- pkg/mgmt/volume/start.go | 10 +++++----- pkg/mgmt/volume/volume.go | 7 ++++--- pkg/version/version.go | 2 +- tests/suite_test.go | 9 +++++---- 19 files changed, 42 insertions(+), 37 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index c6058d52..f2bd98ba 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -23,12 +23,13 @@ import ( "os" "regexp" - config "github.com/openebs/device-localpv/pkg/config" + "github.com/spf13/cobra" + "k8s.io/klog/v2" + + "github.com/openebs/device-localpv/pkg/config" "github.com/openebs/device-localpv/pkg/device" "github.com/openebs/device-localpv/pkg/driver" "github.com/openebs/device-localpv/pkg/version" - "github.com/spf13/cobra" - "k8s.io/klog" ) /* diff --git a/go.mod b/go.mod index ed9afafe..078593f5 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( k8s.io/apimachinery v0.27.2 k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/code-generator v0.27.2 - k8s.io/klog v1.0.0 + k8s.io/klog/v2 v2.100.1 k8s.io/utils v0.0.0-20230505201702-9f6742963106 sigs.k8s.io/controller-runtime v0.2.0 sigs.k8s.io/yaml v1.3.0 @@ -74,7 +74,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.27.2 // indirect k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect - k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230525220651-2546d827e515 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/go.sum b/go.sum index 2b3d905e..c40529e7 100644 --- a/go.sum +++ b/go.sum @@ -809,8 +809,6 @@ k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAE k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08= k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= diff --git a/pkg/collector/collector.go b/pkg/collector/collector.go index cb64671d..deaa9eca 100644 --- a/pkg/collector/collector.go +++ b/pkg/collector/collector.go @@ -21,9 +21,10 @@ import ( "sync" "time" - "github.com/openebs/device-localpv/pkg/device" "github.com/prometheus/client_golang/prometheus" - "k8s.io/klog" + "k8s.io/klog/v2" + + "github.com/openebs/device-localpv/pkg/device" ) const refreshInterval = 1 * time.Minute diff --git a/pkg/device/device-util.go b/pkg/device/device-util.go index 1765a9ce..d8611c8c 100644 --- a/pkg/device/device-util.go +++ b/pkg/device/device-util.go @@ -27,7 +27,7 @@ import ( "github.com/openebs/lib-csi/pkg/common/errors" "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/klog" + "k8s.io/klog/v2" apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" ) diff --git a/pkg/device/mount.go b/pkg/device/mount.go index 62eb71b7..e50ff6ca 100644 --- a/pkg/device/mount.go +++ b/pkg/device/mount.go @@ -19,13 +19,14 @@ import ( "fmt" "os" - apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" mnt "github.com/openebs/lib-csi/pkg/mount" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "k8s.io/klog" + "k8s.io/klog/v2" utilexec "k8s.io/utils/exec" "k8s.io/utils/mount" + + apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" ) // MountInfo contains the volume related info diff --git a/pkg/device/volume.go b/pkg/device/volume.go index 6f31be75..7539ba4c 100644 --- a/pkg/device/volume.go +++ b/pkg/device/volume.go @@ -24,7 +24,7 @@ import ( "google.golang.org/grpc/status" k8serror "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog" + "k8s.io/klog/v2" apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" "github.com/openebs/device-localpv/pkg/builder/volbuilder" diff --git a/pkg/driver/agent.go b/pkg/driver/agent.go index f7137fab..083ef9fa 100644 --- a/pkg/driver/agent.go +++ b/pkg/driver/agent.go @@ -22,8 +22,6 @@ import ( "sync" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/openebs/device-localpv/pkg/collector" - "github.com/openebs/device-localpv/pkg/config" k8sapi "github.com/openebs/lib-csi/pkg/client/k8s" "github.com/openebs/lib-csi/pkg/mount" "github.com/prometheus/client_golang/prometheus" @@ -34,9 +32,12 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog" + "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/runtime/signals" + "github.com/openebs/device-localpv/pkg/collector" + "github.com/openebs/device-localpv/pkg/config" + apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" "github.com/openebs/device-localpv/pkg/builder/volbuilder" "github.com/openebs/device-localpv/pkg/device" diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go index 64d136bf..f964cba0 100644 --- a/pkg/driver/controller.go +++ b/pkg/driver/controller.go @@ -39,7 +39,7 @@ import ( kubeinformers "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" - "k8s.io/klog" + "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/runtime/signals" apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" diff --git a/pkg/driver/driver.go b/pkg/driver/driver.go index 59be1723..05c158f8 100644 --- a/pkg/driver/driver.go +++ b/pkg/driver/driver.go @@ -18,8 +18,9 @@ package driver import ( "github.com/container-storage-interface/spec/lib/go/csi" - config "github.com/openebs/device-localpv/pkg/config" - "k8s.io/klog" + "k8s.io/klog/v2" + + "github.com/openebs/device-localpv/pkg/config" ) // volume can only be published once as diff --git a/pkg/driver/grpc.go b/pkg/driver/grpc.go index 35031c3f..ea742db1 100644 --- a/pkg/driver/grpc.go +++ b/pkg/driver/grpc.go @@ -28,7 +28,7 @@ import ( "google.golang.org/grpc" "github.com/kubernetes-csi/csi-lib-utils/protosanitizer" - "k8s.io/klog" + "k8s.io/klog/v2" "github.com/container-storage-interface/spec/lib/go/csi" ) diff --git a/pkg/driver/schd_helper.go b/pkg/driver/schd_helper.go index 9f27a4ea..036e01d3 100644 --- a/pkg/driver/schd_helper.go +++ b/pkg/driver/schd_helper.go @@ -17,10 +17,11 @@ limitations under the License. package driver import ( - "k8s.io/klog" "regexp" "strconv" + "k8s.io/klog/v2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/openebs/device-localpv/pkg/builder/volbuilder" diff --git a/pkg/mgmt/devicenode/builder.go b/pkg/mgmt/devicenode/builder.go index 9d5796e3..a167db78 100644 --- a/pkg/mgmt/devicenode/builder.go +++ b/pkg/mgmt/devicenode/builder.go @@ -27,7 +27,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "k8s.io/klog" + "k8s.io/klog/v2" clientset "github.com/openebs/device-localpv/pkg/generated/clientset/internalclientset" openebsScheme "github.com/openebs/device-localpv/pkg/generated/clientset/internalclientset/scheme" diff --git a/pkg/mgmt/devicenode/devicenode.go b/pkg/mgmt/devicenode/devicenode.go index 92fc125c..ebb8cb5d 100644 --- a/pkg/mgmt/devicenode/devicenode.go +++ b/pkg/mgmt/devicenode/devicenode.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" - "k8s.io/klog" + "k8s.io/klog/v2" apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" "github.com/openebs/device-localpv/pkg/builder/nodebuilder" diff --git a/pkg/mgmt/volume/builder.go b/pkg/mgmt/volume/builder.go index 8f75508c..cd994bb8 100644 --- a/pkg/mgmt/volume/builder.go +++ b/pkg/mgmt/volume/builder.go @@ -24,7 +24,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "k8s.io/klog" + "k8s.io/klog/v2" clientset "github.com/openebs/device-localpv/pkg/generated/clientset/internalclientset" openebsScheme "github.com/openebs/device-localpv/pkg/generated/clientset/internalclientset/scheme" diff --git a/pkg/mgmt/volume/start.go b/pkg/mgmt/volume/start.go index 546034e9..ab233742 100644 --- a/pkg/mgmt/volume/start.go +++ b/pkg/mgmt/volume/start.go @@ -18,18 +18,18 @@ package volume import ( "sync" + "time" "github.com/pkg/errors" - "time" - - clientset "github.com/openebs/device-localpv/pkg/generated/clientset/internalclientset" - informers "github.com/openebs/device-localpv/pkg/generated/informer/externalversions" kubeinformers "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "k8s.io/klog" + "k8s.io/klog/v2" + + clientset "github.com/openebs/device-localpv/pkg/generated/clientset/internalclientset" + informers "github.com/openebs/device-localpv/pkg/generated/informer/externalversions" ) var ( diff --git a/pkg/mgmt/volume/volume.go b/pkg/mgmt/volume/volume.go index b7945821..e555a105 100644 --- a/pkg/mgmt/volume/volume.go +++ b/pkg/mgmt/volume/volume.go @@ -20,13 +20,14 @@ import ( "fmt" "time" - apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" - "github.com/openebs/device-localpv/pkg/device" k8serror "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" - "k8s.io/klog" + "k8s.io/klog/v2" + + apis "github.com/openebs/device-localpv/pkg/apis/openebs.io/device/v1alpha1" + "github.com/openebs/device-localpv/pkg/device" ) // isDeletionCandidate checks if a device volume is a deletion candidate. diff --git a/pkg/version/version.go b/pkg/version/version.go index a7e5dbb2..c05495da 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -23,7 +23,7 @@ import ( "path/filepath" "strings" - "k8s.io/klog" + "k8s.io/klog/v2" ) var ( diff --git a/tests/suite_test.go b/tests/suite_test.go index 57af1e17..3d750d39 100644 --- a/tests/suite_test.go +++ b/tests/suite_test.go @@ -22,16 +22,17 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + storagev1 "k8s.io/api/storage/v1" + "k8s.io/klog/v2" + "github.com/openebs/device-localpv/pkg/builder/nodebuilder" "github.com/openebs/device-localpv/pkg/builder/volbuilder" "github.com/openebs/device-localpv/tests/deploy" "github.com/openebs/device-localpv/tests/pod" "github.com/openebs/device-localpv/tests/pvc" "github.com/openebs/device-localpv/tests/sc" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - "k8s.io/klog" // auth plugins _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"