From b905cab3799cdc482bac1008a59badd4ccebd996 Mon Sep 17 00:00:00 2001 From: Fred Rolland Date: Sun, 1 May 2022 12:22:42 +0300 Subject: [PATCH] Fix deadcode and goimports issues This commit fix the issues found by: `golangci-lint run --disable-all -E deadcode` and `golangci-lint run --disable-all -E goimports` Signed-off-by: Fred Rolland --- cmd/webhook/start.go | 2 +- controllers/suite_test.go | 1 - pkg/render/render.go | 1 - pkg/utils/shutdown.go | 7 ------- pkg/webhook/webhook.go | 2 +- test/e2e/e2e_tests_suite_test.go | 1 - 6 files changed, 2 insertions(+), 12 deletions(-) diff --git a/cmd/webhook/start.go b/cmd/webhook/start.go index a0046e383..0185b1bd9 100644 --- a/cmd/webhook/start.go +++ b/cmd/webhook/start.go @@ -10,7 +10,7 @@ import ( "github.com/fsnotify/fsnotify" "github.com/golang/glog" "github.com/spf13/cobra" - "k8s.io/api/admission/v1" + v1 "k8s.io/api/admission/v1" "k8s.io/apimachinery/pkg/runtime" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/webhook" diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 034e5811c..a95ac6b42 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -57,7 +57,6 @@ const ( testNamespace = "openshift-sriov-network-operator" timeout = time.Second * 10 - duration = time.Second * 100 interval = time.Millisecond * 250 ) diff --git a/pkg/render/render.go b/pkg/render/render.go index 1b49b5316..59c215387 100644 --- a/pkg/render/render.go +++ b/pkg/render/render.go @@ -40,7 +40,6 @@ const ( filesDir = "files" ovsUnitsDir = "ovs-units" switchdevUnitsDir = "switchdev-units" - platformBase = "bindata/manifests/machine-config" ) func MakeRenderData() RenderData { diff --git a/pkg/utils/shutdown.go b/pkg/utils/shutdown.go index f000037ce..d2969d8f9 100644 --- a/pkg/utils/shutdown.go +++ b/pkg/utils/shutdown.go @@ -6,7 +6,6 @@ import ( snclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" admv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes" ctrl "sigs.k8s.io/controller-runtime" @@ -17,12 +16,6 @@ import ( var shutdownLog = ctrl.Log.WithName("shutdown") -var sriovnetworksGVR = schema.GroupVersionResource{ - Group: "sriovnetwork.openshift.io", - Version: "v1", - Resource: "sriovnetworks", -} - var failurePolicyIgnore = admv1.Ignore func Shutdown() { diff --git a/pkg/webhook/webhook.go b/pkg/webhook/webhook.go index 18d055c5f..6adb1a87e 100644 --- a/pkg/webhook/webhook.go +++ b/pkg/webhook/webhook.go @@ -5,7 +5,7 @@ import ( "os" "github.com/golang/glog" - "k8s.io/api/admission/v1" + v1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" diff --git a/test/e2e/e2e_tests_suite_test.go b/test/e2e/e2e_tests_suite_test.go index fdfcb1bcb..cc6858a46 100644 --- a/test/e2e/e2e_tests_suite_test.go +++ b/test/e2e/e2e_tests_suite_test.go @@ -40,7 +40,6 @@ var doneNetNsSet chan error // Define utility constants for object names and testing timeouts/durations and intervals. const ( timeout = time.Second * 30 - duration = time.Second * 300 interval = time.Second * 1 devPollInterval = time.Millisecond * 400 )