From 52125439556c79adff90dd12c6ad89d4a0830ead Mon Sep 17 00:00:00 2001 From: umagnus Date: Mon, 20 Nov 2023 07:51:28 +0000 Subject: [PATCH 1/2] upgrade golangci/golangci-lint-action to v1.54 --- .github/workflows/static.yaml | 4 ++-- .golangci.yml | 13 +++++++++++++ pkg/azuredisk/azure_common_linux.go | 8 ++++---- pkg/azuredisk/azuredisk_test.go | 2 ++ pkg/azuredisk/controllerserver.go | 4 ++-- pkg/azuredisk/identityserver.go | 6 +++--- pkg/azuredisk/nodeserver.go | 14 +++++++------- pkg/azurediskplugin/main.go | 2 +- pkg/azureutils/fake_iohandler.go | 4 ++-- pkg/csi-common/server_test.go | 12 ++++++------ pkg/mounter/fake_safe_mounter.go | 4 ++-- pkg/mounter/safe_mounter_unix.go | 2 +- pkg/optimization/azure_skus_map.go | 1 + pkg/optimization/skus_test.go | 2 +- pkg/os/filesystem/filesystem.go | 2 +- test/e2e/dynamic_provisioning_test.go | 2 ++ .../dynamically_provisioned_delete_pod_tester.go | 1 + ...amically_provisioned_read_only_volume_tester.go | 1 + .../dynamically_provisioned_shared_disk_tester.go | 1 + ...namically_provisioned_statefulset_e2e_tester.go | 1 + .../pre_provisioned_read_only_volume_tester.go | 1 + .../pre_provisioned_shared_disk_tester.go | 1 + test/e2e/testsuites/specs.go | 2 +- 23 files changed, 57 insertions(+), 33 deletions(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 23c90e2d8b..60e9ac0300 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -15,5 +15,5 @@ jobs: - name: Run linter uses: golangci/golangci-lint-action@v3 with: - version: v1.51 - args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s + version: v1.54 + args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s diff --git a/.golangci.yml b/.golangci.yml index bf43d3e640..666ec5ffa3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,3 +7,16 @@ linters: - structcheck enable: - golint + +linters-settings: + depguard: + rules: + main: + files: + - $all + - "!$test" + allow: + - $gostd + - k8s.io + - sigs.k8s.io + - github.com diff --git a/pkg/azuredisk/azure_common_linux.go b/pkg/azuredisk/azure_common_linux.go index 6d832808f3..537a163a0c 100644 --- a/pkg/azuredisk/azure_common_linux.go +++ b/pkg/azuredisk/azure_common_linux.go @@ -81,7 +81,7 @@ func getDiskLinkByDevName(io azureutils.IOHandler, devLinkPath, devName string) return "", fmt.Errorf("read %s error: %v", devLinkPath, err) } -func scsiHostRescan(io azureutils.IOHandler, m *mount.SafeFormatAndMount) { +func scsiHostRescan(io azureutils.IOHandler, _ *mount.SafeFormatAndMount) { scsiPath := "/sys/class/scsi_host/" if dirs, err := io.ReadDir(scsiPath); err == nil { for _, f := range dirs { @@ -96,7 +96,7 @@ func scsiHostRescan(io azureutils.IOHandler, m *mount.SafeFormatAndMount) { } } -func findDiskByLun(lun int, io azureutils.IOHandler, m *mount.SafeFormatAndMount) (string, error) { +func findDiskByLun(lun int, io azureutils.IOHandler, _ *mount.SafeFormatAndMount) (string, error) { azureDisks := listAzureDiskPath(io) return findDiskByLunWithConstraint(lun, io, azureDisks) } @@ -196,7 +196,7 @@ func findDiskByLunWithConstraint(lun int, io azureutils.IOHandler, azureDisks [] return "", err } -func preparePublishPath(path string, m *mount.SafeFormatAndMount) error { +func preparePublishPath(_ string, _ *mount.SafeFormatAndMount) error { return nil } @@ -269,7 +269,7 @@ func rescanAllVolumes(io azureutils.IOHandler) error { return nil } -func GetVolumeStats(ctx context.Context, m *mount.SafeFormatAndMount, target string, hostutil hostUtil) ([]*csi.VolumeUsage, error) { +func GetVolumeStats(_ context.Context, m *mount.SafeFormatAndMount, target string, hostutil hostUtil) ([]*csi.VolumeUsage, error) { var volUsages []*csi.VolumeUsage _, err := os.Stat(target) if err != nil { diff --git a/pkg/azuredisk/azuredisk_test.go b/pkg/azuredisk/azuredisk_test.go index 971bdb84e4..20e08a57cd 100644 --- a/pkg/azuredisk/azuredisk_test.go +++ b/pkg/azuredisk/azuredisk_test.go @@ -296,6 +296,7 @@ func TestWaitForSnapshot(t *testing.T) { } }, }, + //nolint:dupl { name: "timeout for waiting snapshot copy cross region", testFunc: func(t *testing.T) { @@ -336,6 +337,7 @@ func TestWaitForSnapshot(t *testing.T) { } }, }, + //nolint:dupl { name: "succeed for waiting snapshot copy cross region", testFunc: func(t *testing.T) { diff --git a/pkg/azuredisk/controllerserver.go b/pkg/azuredisk/controllerserver.go index e88c71c3c3..e6eecc7960 100644 --- a/pkg/azuredisk/controllerserver.go +++ b/pkg/azuredisk/controllerserver.go @@ -547,14 +547,14 @@ func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.Valida } // ControllerGetCapabilities returns the capabilities of the Controller plugin -func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) { +func (d *Driver) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) { return &csi.ControllerGetCapabilitiesResponse{ Capabilities: d.Cap, }, nil } // GetCapacity returns the capacity of the total available storage pool -func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) { +func (d *Driver) GetCapacity(_ context.Context, _ *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) { return nil, status.Error(codes.Unimplemented, "") } diff --git a/pkg/azuredisk/identityserver.go b/pkg/azuredisk/identityserver.go index b3e2e92453..1c4b5a78ec 100644 --- a/pkg/azuredisk/identityserver.go +++ b/pkg/azuredisk/identityserver.go @@ -28,7 +28,7 @@ import ( ) // GetPluginInfo return the version and name of the plugin -func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) { +func (f *Driver) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) { if f.Name == "" { return nil, status.Error(codes.Unavailable, "Driver name not configured") } @@ -47,12 +47,12 @@ func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoReques // This method does not need to return anything. // Currently the spec does not dictate what you should return either. // Hence, return an empty response -func (f *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error) { +func (f *Driver) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error) { return &csi.ProbeResponse{Ready: &wrappers.BoolValue{Value: true}}, nil } // GetPluginCapabilities returns the capabilities of the plugin -func (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) { +func (f *Driver) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) { capabilities := []*csi.PluginCapability{ { Type: &csi.PluginCapability_Service_{ diff --git a/pkg/azuredisk/nodeserver.go b/pkg/azuredisk/nodeserver.go index b0e1d56d03..3ecf5e3890 100644 --- a/pkg/azuredisk/nodeserver.go +++ b/pkg/azuredisk/nodeserver.go @@ -58,7 +58,7 @@ func getDefaultFsType() string { } // NodeStageVolume mount disk device to a staging path -func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { +func (d *Driver) NodeStageVolume(_ context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { diskURI := req.GetVolumeId() if len(diskURI) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") @@ -182,7 +182,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe } // NodeUnstageVolume unmount disk device from a staging path -func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { +func (d *Driver) NodeUnstageVolume(_ context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { volumeID := req.GetVolumeId() if len(volumeID) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") @@ -209,7 +209,7 @@ func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolu } // NodePublishVolume mount the volume from staging to target path -func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { +func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { volumeID := req.GetVolumeId() if len(volumeID) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID missing in the request") @@ -287,7 +287,7 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu } // NodeUnpublishVolume unmount the volume from the target path -func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) { +func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) { targetPath := req.GetTargetPath() volumeID := req.GetVolumeId() @@ -310,14 +310,14 @@ func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublish } // NodeGetCapabilities return the capabilities of the Node plugin -func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) { +func (d *Driver) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) { return &csi.NodeGetCapabilitiesResponse{ Capabilities: d.NSCap, }, nil } // NodeGetInfo return info of the node on which this plugin is running -func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) { +func (d *Driver) NodeGetInfo(ctx context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) { topology := &csi.Topology{ Segments: map[string]string{topologyKey: ""}, } @@ -451,7 +451,7 @@ func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeS } // NodeExpandVolume node expand volume -func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) { +func (d *Driver) NodeExpandVolume(_ context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) { volumeID := req.GetVolumeId() if len(volumeID) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") diff --git a/pkg/azurediskplugin/main.go b/pkg/azurediskplugin/main.go index 0cfd0ddde6..e7e34f01c2 100644 --- a/pkg/azurediskplugin/main.go +++ b/pkg/azurediskplugin/main.go @@ -156,7 +156,7 @@ func exportMetrics() { serve(context.Background(), l, serveMetrics) } -func serve(ctx context.Context, l net.Listener, serveFunc func(net.Listener) error) { +func serve(_ context.Context, l net.Listener, serveFunc func(net.Listener) error) { path := l.Addr().String() klog.V(2).Infof("set up prometheus server on %v", path) go func() { diff --git a/pkg/azureutils/fake_iohandler.go b/pkg/azureutils/fake_iohandler.go index d22db0ad05..1cdb0fbd4e 100644 --- a/pkg/azureutils/fake_iohandler.go +++ b/pkg/azureutils/fake_iohandler.go @@ -127,11 +127,11 @@ func (handler *fakeIOHandler) ReadDir(dirname string) ([]os.DirEntry, error) { return nil, fmt.Errorf("bad dir") } -func (handler *fakeIOHandler) WriteFile(filename string, data []byte, perm os.FileMode) error { +func (handler *fakeIOHandler) WriteFile(_ string, _ []byte, _ os.FileMode) error { return nil } -func (handler *fakeIOHandler) Readlink(name string) (string, error) { +func (handler *fakeIOHandler) Readlink(_ string) (string, error) { return "/dev/azure/disk/sda", nil } diff --git a/pkg/csi-common/server_test.go b/pkg/csi-common/server_test.go index ffd417057e..09678052bc 100644 --- a/pkg/csi-common/server_test.go +++ b/pkg/csi-common/server_test.go @@ -30,7 +30,7 @@ func TestNewNonBlockingGRPCServer(t *testing.T) { assert.NotNil(t, s) } -func TestStart(t *testing.T) { +func TestStart(_ *testing.T) { s := NewNonBlockingGRPCServer() // sleep a while to avoid race condition in unit test time.Sleep(time.Millisecond * 500) @@ -38,7 +38,7 @@ func TestStart(t *testing.T) { time.Sleep(time.Millisecond * 500) } -func TestStartWithOtelTracing(t *testing.T) { +func TestStartWithOtelTracing(_ *testing.T) { s := NewNonBlockingGRPCServer() // sleep a while to avoid race condition in unit test time.Sleep(time.Millisecond * 500) @@ -46,7 +46,7 @@ func TestStartWithOtelTracing(t *testing.T) { time.Sleep(time.Millisecond * 500) } -func TestServe(t *testing.T) { +func TestServe(_ *testing.T) { s := nonBlockingGRPCServer{} s.server = grpc.NewServer() s.wg = sync.WaitGroup{} @@ -55,20 +55,20 @@ func TestServe(t *testing.T) { s.serve("tcp://127.0.0.1:0", nil, nil, nil, true, false) } -func TestWait(t *testing.T) { +func TestWait(_ *testing.T) { s := nonBlockingGRPCServer{} s.server = grpc.NewServer() s.wg = sync.WaitGroup{} s.Wait() } -func TestStop(t *testing.T) { +func TestStop(_ *testing.T) { s := nonBlockingGRPCServer{} s.server = grpc.NewServer() s.Stop() } -func TestForceStop(t *testing.T) { +func TestForceStop(_ *testing.T) { s := nonBlockingGRPCServer{} s.server = grpc.NewServer() s.ForceStop() diff --git a/pkg/mounter/fake_safe_mounter.go b/pkg/mounter/fake_safe_mounter.go index 0f94d01cad..4d392e790c 100644 --- a/pkg/mounter/fake_safe_mounter.go +++ b/pkg/mounter/fake_safe_mounter.go @@ -48,7 +48,7 @@ func NewFakeSafeMounter() (*mount.SafeFormatAndMount, error) { } // Mount overrides mount.FakeMounter.Mount. -func (f *FakeSafeMounter) Mount(source, target, fstype string, options []string) error { +func (f *FakeSafeMounter) Mount(source, target, _ string, _ []string) error { if strings.Contains(source, "error_mount") { return fmt.Errorf("fake Mount: source error") } else if strings.Contains(target, "error_mount") { @@ -59,7 +59,7 @@ func (f *FakeSafeMounter) Mount(source, target, fstype string, options []string) } // MountSensitive overrides mount.FakeMounter.MountSensitive. -func (f *FakeSafeMounter) MountSensitive(source, target, fstype string, options, sensitiveOptions []string) error { +func (f *FakeSafeMounter) MountSensitive(source, target, _ string, _, _ []string) error { if strings.Contains(source, "error_mount_sens") { return fmt.Errorf("fake MountSensitive: source error") } else if strings.Contains(target, "error_mount_sens") { diff --git a/pkg/mounter/safe_mounter_unix.go b/pkg/mounter/safe_mounter_unix.go index f1f539fb90..22189c28c2 100644 --- a/pkg/mounter/safe_mounter_unix.go +++ b/pkg/mounter/safe_mounter_unix.go @@ -24,7 +24,7 @@ import ( utilexec "k8s.io/utils/exec" ) -func NewSafeMounter(enableWindowsHostProcess, useCSIProxyGAInterface bool) (*mount.SafeFormatAndMount, error) { +func NewSafeMounter(_, _ bool) (*mount.SafeFormatAndMount, error) { return &mount.SafeFormatAndMount{ Interface: mount.New(""), Exec: utilexec.New(), diff --git a/pkg/optimization/azure_skus_map.go b/pkg/optimization/azure_skus_map.go index e138c6b9c6..9a5a334b63 100644 --- a/pkg/optimization/azure_skus_map.go +++ b/pkg/optimization/azure_skus_map.go @@ -16,6 +16,7 @@ limitations under the License. package optimization +//nolint:dupl var ( DiskSkuMap = map[string]map[string]DiskSkuInfo{ "premium_lrs": { diff --git a/pkg/optimization/skus_test.go b/pkg/optimization/skus_test.go index f8eb720282..b5ef900b23 100644 --- a/pkg/optimization/skus_test.go +++ b/pkg/optimization/skus_test.go @@ -31,7 +31,7 @@ type fakeCloud struct { fakecloud.Cloud } -func (fake *fakeCloud) InstanceType(ctx context.Context, nodeName types.NodeName) (string, error) { +func (fake *fakeCloud) InstanceType(_ context.Context, nodeName types.NodeName) (string, error) { if instanceType, ok := fake.InstanceTypes[nodeName]; ok { return instanceType, nil } diff --git a/pkg/os/filesystem/filesystem.go b/pkg/os/filesystem/filesystem.go index 919550b405..13fe3f2377 100644 --- a/pkg/os/filesystem/filesystem.go +++ b/pkg/os/filesystem/filesystem.go @@ -80,7 +80,7 @@ func PathExists(path string) (bool, error) { return pathExists(path) } -func PathValid(ctx context.Context, path string) (bool, error) { +func PathValid(_ context.Context, path string) (bool, error) { cmd := `Test-Path $Env:remotepath` output, err := util.RunPowershellCmd(cmd, fmt.Sprintf("remotepath=%s", path)) if err != nil { diff --git a/test/e2e/dynamic_provisioning_test.go b/test/e2e/dynamic_provisioning_test.go index 8d9875080f..8de7dffccd 100644 --- a/test/e2e/dynamic_provisioning_test.go +++ b/test/e2e/dynamic_provisioning_test.go @@ -813,6 +813,7 @@ func (t *dynamicProvisioningTestSuite) defineTests(isMultiZone bool) { test.Run(ctx, cs, snapshotrcs, ns) }) + //nolint:dupl ginkgo.It("should create a pod with small storage size, take a volume snapshot cross region, and restore disk in another region [disk.csi.azure.com]", func(ctx ginkgo.SpecContext) { skipIfUsingInTreeVolumePlugin() skipIfTestingInWindowsCluster() @@ -856,6 +857,7 @@ func (t *dynamicProvisioningTestSuite) defineTests(isMultiZone bool) { test.Run(ctx, cs, snapshotrcs, ns) }) + //nolint:dupl ginkgo.It("should create a pod with large storage size, take a volume snapshot cross region, and restore disk in another region [disk.csi.azure.com]", func(ctx ginkgo.SpecContext) { skipIfUsingInTreeVolumePlugin() skipIfTestingInWindowsCluster() diff --git a/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go b/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go index e9db6f0934..c4686958ed 100644 --- a/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go @@ -40,6 +40,7 @@ type PodExecCheck struct { ExpectedString string } +//nolint:dupl func (t *DynamicallyProvisionedDeletePodTest) Run(ctx context.Context, client clientset.Interface, namespace *v1.Namespace) { tDeployment, cleanup := t.Pod.SetupDeployment(ctx, client, namespace, t.CSIDriver, driver.GetParameters()) // defer must be called here for resources not get removed before using them diff --git a/test/e2e/testsuites/dynamically_provisioned_read_only_volume_tester.go b/test/e2e/testsuites/dynamically_provisioned_read_only_volume_tester.go index 579271ac8d..3a447727c8 100644 --- a/test/e2e/testsuites/dynamically_provisioned_read_only_volume_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_read_only_volume_tester.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +//nolint:dupl package testsuites import ( diff --git a/test/e2e/testsuites/dynamically_provisioned_shared_disk_tester.go b/test/e2e/testsuites/dynamically_provisioned_shared_disk_tester.go index d36737e412..fe0deb5a68 100644 --- a/test/e2e/testsuites/dynamically_provisioned_shared_disk_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_shared_disk_tester.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +//nolint:dupl package testsuites import ( diff --git a/test/e2e/testsuites/dynamically_provisioned_statefulset_e2e_tester.go b/test/e2e/testsuites/dynamically_provisioned_statefulset_e2e_tester.go index 7b97b0cd99..438a91c30e 100644 --- a/test/e2e/testsuites/dynamically_provisioned_statefulset_e2e_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_statefulset_e2e_tester.go @@ -34,6 +34,7 @@ type DynamicallyProvisionedStatefulSetTest struct { PodCheck *PodExecCheck } +//nolint:dupl func (t *DynamicallyProvisionedStatefulSetTest) Run(ctx context.Context, client clientset.Interface, namespace *v1.Namespace) { tStatefulSet, cleanup := t.Pod.SetupStatefulset(ctx, client, namespace, t.CSIDriver, driver.GetParameters()) // defer must be called here for resources not get removed before using them diff --git a/test/e2e/testsuites/pre_provisioned_read_only_volume_tester.go b/test/e2e/testsuites/pre_provisioned_read_only_volume_tester.go index f51c7ff370..bc40afeef8 100644 --- a/test/e2e/testsuites/pre_provisioned_read_only_volume_tester.go +++ b/test/e2e/testsuites/pre_provisioned_read_only_volume_tester.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +//nolint:dupl package testsuites import ( diff --git a/test/e2e/testsuites/pre_provisioned_shared_disk_tester.go b/test/e2e/testsuites/pre_provisioned_shared_disk_tester.go index 43fb196d79..b454baf574 100644 --- a/test/e2e/testsuites/pre_provisioned_shared_disk_tester.go +++ b/test/e2e/testsuites/pre_provisioned_shared_disk_tester.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +//nolint:dupl package testsuites import ( diff --git a/test/e2e/testsuites/specs.go b/test/e2e/testsuites/specs.go index b5df077d2d..8a65a40b15 100644 --- a/test/e2e/testsuites/specs.go +++ b/test/e2e/testsuites/specs.go @@ -148,7 +148,7 @@ func (pod *PodDetails) SetupWithDynamicVolumesWithSubpath(ctx context.Context, c return tpod, cleanupFuncs } -func (pod *PodDetails) SetupWithInlineVolumes(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.PreProvisionedVolumeTestDriver, diskURI string, readOnly bool) (*TestPod, []func(context.Context)) { +func (pod *PodDetails) SetupWithInlineVolumes(client clientset.Interface, namespace *v1.Namespace, _ driver.PreProvisionedVolumeTestDriver, diskURI string, readOnly bool) (*TestPod, []func(context.Context)) { tpod := NewTestPod(client, namespace, pod.Cmd, pod.IsWindows, pod.WinServerVer) cleanupFuncs := make([]func(context.Context), 0) for n, v := range pod.Volumes { From e3bd289108a0f03922f63f3c7d089e8d876895c4 Mon Sep 17 00:00:00 2001 From: umagnus Date: Mon, 20 Nov 2023 07:55:04 +0000 Subject: [PATCH 2/2] clean up parm in func --- test/e2e/testsuites/pre_provisioned_inline_volume_tester.go | 2 +- test/e2e/testsuites/specs.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/testsuites/pre_provisioned_inline_volume_tester.go b/test/e2e/testsuites/pre_provisioned_inline_volume_tester.go index 21d87cda15..3cf016351f 100644 --- a/test/e2e/testsuites/pre_provisioned_inline_volume_tester.go +++ b/test/e2e/testsuites/pre_provisioned_inline_volume_tester.go @@ -38,7 +38,7 @@ type PreProvisionedInlineVolumeTest struct { func (t *PreProvisionedInlineVolumeTest) Run(ctx context.Context, client clientset.Interface, namespace *v1.Namespace) { for _, pod := range t.Pods { - tpod, cleanup := pod.SetupWithInlineVolumes(client, namespace, t.CSIDriver, t.DiskURI, t.ReadOnly) + tpod, cleanup := pod.SetupWithInlineVolumes(client, namespace, t.DiskURI, t.ReadOnly) // defer must be called here for resources not get removed before using them for i := range cleanup { defer cleanup[i](ctx) diff --git a/test/e2e/testsuites/specs.go b/test/e2e/testsuites/specs.go index 8a65a40b15..8d1497e1e6 100644 --- a/test/e2e/testsuites/specs.go +++ b/test/e2e/testsuites/specs.go @@ -148,7 +148,7 @@ func (pod *PodDetails) SetupWithDynamicVolumesWithSubpath(ctx context.Context, c return tpod, cleanupFuncs } -func (pod *PodDetails) SetupWithInlineVolumes(client clientset.Interface, namespace *v1.Namespace, _ driver.PreProvisionedVolumeTestDriver, diskURI string, readOnly bool) (*TestPod, []func(context.Context)) { +func (pod *PodDetails) SetupWithInlineVolumes(client clientset.Interface, namespace *v1.Namespace, diskURI string, readOnly bool) (*TestPod, []func(context.Context)) { tpod := NewTestPod(client, namespace, pod.Cmd, pod.IsWindows, pod.WinServerVer) cleanupFuncs := make([]func(context.Context), 0) for n, v := range pod.Volumes {