From 1fb3445692282bc41a7f09bf2efa187dacffa2d8 Mon Sep 17 00:00:00 2001 From: Sean Malloy Date: Mon, 24 Aug 2020 23:13:03 -0500 Subject: [PATCH] Fix golangci-lint Failures For 1.30.0 Upgrade --- Makefile | 2 +- pkg/descheduler/node/node_test.go | 4 ++-- test/e2e/e2e_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d90c2bff4..ec7757d09 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ LDFLAG_LOCATION=sigs.k8s.io/descheduler/cmd/descheduler/app LDFLAGS=-ldflags "-X ${LDFLAG_LOCATION}.version=${VERSION} -X ${LDFLAG_LOCATION}.buildDate=${BUILD} -X ${LDFLAG_LOCATION}.gitCommit=${COMMIT}" -GOLANGCI_VERSION := v1.15.0 +GOLANGCI_VERSION := v1.30.0 HAS_GOLANGCI := $(shell ls _output/bin/golangci-lint) # REGISTRY is the container registry to push diff --git a/pkg/descheduler/node/node_test.go b/pkg/descheduler/node/node_test.go index 95af44ad9..a5f1829e8 100644 --- a/pkg/descheduler/node/node_test.go +++ b/pkg/descheduler/node/node_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" @@ -69,7 +69,7 @@ func TestReadyNodesWithNodeSelector(t *testing.T) { sharedInformerFactory := informers.NewSharedInformerFactory(fakeClient, 0) nodeInformer := sharedInformerFactory.Core().V1().Nodes() - stopChannel := make(chan struct{}, 0) + stopChannel := make(chan struct{}) sharedInformerFactory.Start(stopChannel) sharedInformerFactory.WaitForCacheSync(stopChannel) defer close(stopChannel) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index eaea2d69d..5d6b97924 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -144,7 +144,7 @@ func initializeClient(t *testing.T) (clientset.Interface, coreinformers.NodeInfo t.Errorf("Error during client creation with %v", err) } - stopChannel := make(chan struct{}, 0) + stopChannel := make(chan struct{}) sharedInformerFactory := informers.NewSharedInformerFactory(clientSet, 0) sharedInformerFactory.Start(stopChannel)