From 063982314b8d4aa76aab2d64e1f379afd73905b0 Mon Sep 17 00:00:00 2001 From: umagnus Date: Mon, 20 Nov 2023 08:29:25 +0000 Subject: [PATCH 1/2] upgrade golangci/golangci-lint-action to v1.54 --- .github/workflows/static.yaml | 4 ++-- .golangci.yml | 12 ++++++++++++ pkg/blob/controllerserver.go | 20 ++++++++++---------- pkg/blob/controllerserver_test.go | 14 ++++++++------ pkg/blob/fake_mount.go | 4 ++-- pkg/blob/identityserver.go | 6 +++--- pkg/blob/nodeserver.go | 12 ++++++------ pkg/blobfuse-proxy/server/server.go | 2 +- pkg/blobplugin/main.go | 2 +- pkg/csi-common/driver_test.go | 2 +- pkg/csi-common/server_test.go | 10 +++++----- pkg/util/util.go | 6 +++--- pkg/util/util_test.go | 5 ++--- test/e2e/driver/blob_csi_driver.go | 2 +- test/e2e/testsuites/specs.go | 2 +- 15 files changed, 58 insertions(+), 45 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 23c90e2d8..60e9ac030 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 new file mode 100644 index 000000000..a7102ad33 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,12 @@ +linters-settings: + depguard: + rules: + main: + files: + - $all + - "!$test" + allow: + - $gostd + - k8s.io + - sigs.k8s.io + - github.com diff --git a/pkg/blob/controllerserver.go b/pkg/blob/controllerserver.go index 7ddc9f2ec..223800d11 100644 --- a/pkg/blob/controllerserver.go +++ b/pkg/blob/controllerserver.go @@ -577,11 +577,11 @@ func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.Valida }, nil } -func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) { +func (d *Driver) ControllerPublishVolume(_ context.Context, _ *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) { return nil, status.Error(codes.Unimplemented, "ControllerPublishVolume is not yet implemented") } -func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) { +func (d *Driver) ControllerUnpublishVolume(_ context.Context, _ *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) { return nil, status.Error(codes.Unimplemented, "ControllerUnpublishVolume is not yet implemented") } @@ -591,39 +591,39 @@ func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRe } // 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, "GetCapacity is not yet implemented") } // ListVolumes return all available volumes -func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) { +func (d *Driver) ListVolumes(_ context.Context, _ *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) { return nil, status.Error(codes.Unimplemented, "ListVolumes is not yet implemented") } // CreateSnapshot create snapshot -func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) { +func (d *Driver) CreateSnapshot(_ context.Context, _ *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) { return nil, status.Error(codes.Unimplemented, "CreateSnapshot is not yet implemented") } // DeleteSnapshot delete snapshot -func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) { +func (d *Driver) DeleteSnapshot(_ context.Context, _ *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) { return nil, status.Error(codes.Unimplemented, "DeleteSnapshot is not yet implemented") } // ListSnapshots list snapshots -func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { +func (d *Driver) ListSnapshots(_ context.Context, _ *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { return nil, status.Error(codes.Unimplemented, "ListSnapshots is not yet implemented") } // 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 } // ControllerExpandVolume controller expand volume -func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) { +func (d *Driver) ControllerExpandVolume(_ context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) { if len(req.GetVolumeId()) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request") } @@ -711,7 +711,7 @@ func (d *Driver) DeleteBlobContainer(ctx context.Context, subsID, resourceGroupN } // CopyBlobContainer copies a blob container in the same storage account -func (d *Driver) copyBlobContainer(ctx context.Context, req *csi.CreateVolumeRequest, accountKey, dstContainerName, storageEndpointSuffix string) error { +func (d *Driver) copyBlobContainer(_ context.Context, req *csi.CreateVolumeRequest, accountKey, dstContainerName, storageEndpointSuffix string) error { var sourceVolumeID string if req.GetVolumeContentSource() != nil && req.GetVolumeContentSource().GetVolume() != nil { sourceVolumeID = req.GetVolumeContentSource().GetVolume().GetVolumeId() diff --git a/pkg/blob/controllerserver_test.go b/pkg/blob/controllerserver_test.go index 86869d3c0..72d406f20 100644 --- a/pkg/blob/controllerserver_test.go +++ b/pkg/blob/controllerserver_test.go @@ -59,7 +59,7 @@ type mockBlobClient struct { conProp *storage.ContainerProperties } -func (c *mockBlobClient) CreateContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string, parameters storage.BlobContainer) *retry.Error { +func (c *mockBlobClient) CreateContainer(_ context.Context, _, _, _, _ string, _ storage.BlobContainer) *retry.Error { switch *c.errorType { case DATAPLANE: return retry.GetError(&http.Response{}, fmt.Errorf(containerBeingDeletedDataplaneAPIError)) @@ -70,7 +70,7 @@ func (c *mockBlobClient) CreateContainer(ctx context.Context, subsID, resourceGr } return nil } -func (c *mockBlobClient) DeleteContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string) *retry.Error { +func (c *mockBlobClient) DeleteContainer(_ context.Context, _, _, _, _ string) *retry.Error { switch *c.errorType { case DATAPLANE: return retry.GetError(&http.Response{}, fmt.Errorf(containerBeingDeletedDataplaneAPIError)) @@ -81,7 +81,7 @@ func (c *mockBlobClient) DeleteContainer(ctx context.Context, subsID, resourceGr } return nil } -func (c *mockBlobClient) GetContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string) (storage.BlobContainer, *retry.Error) { +func (c *mockBlobClient) GetContainer(_ context.Context, _, _, _, _ string) (storage.BlobContainer, *retry.Error) { switch *c.errorType { case DATAPLANE: return storage.BlobContainer{ContainerProperties: c.conProp}, retry.GetError(&http.Response{}, fmt.Errorf(containerBeingDeletedDataplaneAPIError)) @@ -93,11 +93,11 @@ func (c *mockBlobClient) GetContainer(ctx context.Context, subsID, resourceGroup return storage.BlobContainer{ContainerProperties: c.conProp}, nil } -func (c *mockBlobClient) GetServiceProperties(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.BlobServiceProperties, error) { +func (c *mockBlobClient) GetServiceProperties(_ context.Context, _, _, _ string) (storage.BlobServiceProperties, error) { return storage.BlobServiceProperties{}, nil } -func (c *mockBlobClient) SetServiceProperties(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.BlobServiceProperties) (storage.BlobServiceProperties, error) { +func (c *mockBlobClient) SetServiceProperties(_ context.Context, _, _, _ string, _ storage.BlobServiceProperties) (storage.BlobServiceProperties, error) { return storage.BlobServiceProperties{}, nil } @@ -106,7 +106,7 @@ func newMockBlobClient(errorType *errType, custom *string, conProp *storage.Cont } // creates and returns mock storage account client -func NewMockSAClient(ctx context.Context, ctrl *gomock.Controller, subsID, rg, accName string, keyList *[]storage.AccountKey) *mockstorageaccountclient.MockInterface { +func NewMockSAClient(_ context.Context, ctrl *gomock.Controller, _, _, _ string, keyList *[]storage.AccountKey) *mockstorageaccountclient.MockInterface { cl := mockstorageaccountclient.NewMockInterface(ctrl) cl.EXPECT(). @@ -740,6 +740,7 @@ func TestCreateVolume(t *testing.T) { } }, }, + //nolint:dupl { name: "create volume from copy volumesnapshot is not supported", testFunc: func(t *testing.T) { @@ -795,6 +796,7 @@ func TestCreateVolume(t *testing.T) { } }, }, + //nolint:dupl { name: "create volume from copy volume not found", testFunc: func(t *testing.T) { diff --git a/pkg/blob/fake_mount.go b/pkg/blob/fake_mount.go index cafdb2370..d530e5fc8 100644 --- a/pkg/blob/fake_mount.go +++ b/pkg/blob/fake_mount.go @@ -28,7 +28,7 @@ type fakeMounter struct { } // Mount overrides mount.FakeMounter.Mount. -func (f *fakeMounter) Mount(source string, target string, fstype string, options []string) error { +func (f *fakeMounter) Mount(source string, target string, _ string, _ []string) error { if strings.Contains(source, "error_mount") { return fmt.Errorf("fake Mount: source error") } else if strings.Contains(target, "error_mount") { @@ -39,7 +39,7 @@ func (f *fakeMounter) Mount(source string, target string, fstype string, options } // MountSensitive overrides mount.FakeMounter.MountSensitive. -func (f *fakeMounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { +func (f *fakeMounter) MountSensitive(source string, target string, _ string, _ []string, _ []string) error { if strings.Contains(source, "ut-container") { return fmt.Errorf("fake MountSensitive: source error") } else if strings.Contains(target, "error_mount_sens") { diff --git a/pkg/blob/identityserver.go b/pkg/blob/identityserver.go index e14969ef8..bdbbac866 100644 --- a/pkg/blob/identityserver.go +++ b/pkg/blob/identityserver.go @@ -27,7 +27,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") } @@ -46,12 +46,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) { return &csi.GetPluginCapabilitiesResponse{ Capabilities: []*csi.PluginCapability{ { diff --git a/pkg/blob/nodeserver.go b/pkg/blob/nodeserver.go index 8c914cc8a..b78f466d0 100644 --- a/pkg/blob/nodeserver.go +++ b/pkg/blob/nodeserver.go @@ -195,7 +195,7 @@ func (d *Driver) mountBlobfuseInsideDriver(args string, protocol string, authEnv } // 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) { volumeID := req.GetVolumeId() if len(volumeID) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request") @@ -434,7 +434,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe } // NodeUnstageVolume unmount the volume from the 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") @@ -468,26 +468,26 @@ func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolu } // 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(_ context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) { return &csi.NodeGetInfoResponse{ NodeId: d.NodeID, }, nil } // NodeExpandVolume node expand volume -func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) { +func (d *Driver) NodeExpandVolume(_ context.Context, _ *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) { return nil, status.Error(codes.Unimplemented, "NodeExpandVolume is not yet implemented") } // NodeGetVolumeStats get volume stats -func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { +func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { if len(req.VolumeId) == 0 { return nil, status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume ID was empty") } diff --git a/pkg/blobfuse-proxy/server/server.go b/pkg/blobfuse-proxy/server/server.go index c93ec6505..df2add7d7 100644 --- a/pkg/blobfuse-proxy/server/server.go +++ b/pkg/blobfuse-proxy/server/server.go @@ -55,7 +55,7 @@ func NewMountServiceServer() *MountServer { } // MountAzureBlob mounts an azure blob container to given location -func (server *MountServer) MountAzureBlob(ctx context.Context, +func (server *MountServer) MountAzureBlob(_ context.Context, req *mount_azure_blob.MountAzureBlobRequest, ) (resp *mount_azure_blob.MountAzureBlobResponse, err error) { mutex.Lock() diff --git a/pkg/blobplugin/main.go b/pkg/blobplugin/main.go index 13f41bad2..81bb37c04 100644 --- a/pkg/blobplugin/main.go +++ b/pkg/blobplugin/main.go @@ -123,7 +123,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/csi-common/driver_test.go b/pkg/csi-common/driver_test.go index 170c91dd8..aadee7090 100644 --- a/pkg/csi-common/driver_test.go +++ b/pkg/csi-common/driver_test.go @@ -63,7 +63,7 @@ func TestNewFakeDriver(t *testing.T) { assert.Nil(t, d) } -func TestAddControllerServiceCapabilities(t *testing.T) { +func TestAddControllerServiceCapabilities(_ *testing.T) { d := NewFakeDriver() var cl []csi.ControllerServiceCapability_RPC_Type cl = append(cl, csi.ControllerServiceCapability_RPC_UNKNOWN) diff --git a/pkg/csi-common/server_test.go b/pkg/csi-common/server_test.go index aa1b2d044..18e07712c 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 TestServe(t *testing.T) { +func TestServe(_ *testing.T) { s := nonBlockingGRPCServer{} s.server = grpc.NewServer() s.wg = sync.WaitGroup{} @@ -47,20 +47,20 @@ func TestServe(t *testing.T) { s.serve("tcp://127.0.0.1:0", nil, nil, nil, true) } -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/util/util.go b/pkg/util/util.go index 691d2a299..3159ad1e3 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -239,7 +239,7 @@ func (ac *Azcopy) GetAzcopyJob(dstBlobContainer string) (AzcopyJobState, string, klog.Warningf("failed to get azcopy job with error: %v, jobState: %v", err, AzcopyJobError) return AzcopyJobError, "", fmt.Errorf("couldn't list jobs in azcopy %v", err) } - jobid, jobState, err := parseAzcopyJobList(out, dstBlobContainer) + jobid, jobState, err := parseAzcopyJobList(out) if err != nil || jobState == AzcopyJobError { klog.Warningf("failed to get azcopy job with error: %v, jobState: %v", err, jobState) return AzcopyJobError, "", fmt.Errorf("couldn't parse azcopy job list in azcopy %v", err) @@ -266,8 +266,8 @@ func (ac *Azcopy) GetAzcopyJob(dstBlobContainer string) (AzcopyJobState, string, return jobState, percent, nil } -// parseAzcopyJobList parse command azcopy jobs list, get jobid and state from joblist containing dstBlobContainer -func parseAzcopyJobList(joblist string, dstBlobContainer string) (string, AzcopyJobState, error) { +// parseAzcopyJobList parse command azcopy jobs list, get jobid and state from joblist +func parseAzcopyJobList(joblist string) (string, AzcopyJobState, error) { jobid := "" jobSegments := strings.Split(joblist, "JobId: ") if len(jobSegments) < 2 { diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 211460862..dabfd77e9 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -77,7 +77,7 @@ func TestConcurrentLockEntry(t *testing.T) { testLockMap.UnlockEntry("entry1") } -func (lm *LockMap) lockAndCallback(t *testing.T, entry string, callbackChan chan<- interface{}) { +func (lm *LockMap) lockAndCallback(_ *testing.T, entry string, callbackChan chan<- interface{}) { lm.LockEntry(entry) callbackChan <- true } @@ -486,8 +486,7 @@ func TestParseAzcopyJobList(t *testing.T) { } for _, test := range tests { - dstBlobContainer := "dstBlobContainer" - jobid, jobState, err := parseAzcopyJobList(test.str, dstBlobContainer) + jobid, jobState, err := parseAzcopyJobList(test.str) if jobid != test.expectedJobid || jobState != test.expectedJobState || !reflect.DeepEqual(err, test.expectedErr) { t.Errorf("test[%s]: unexpected jobid: %v, jobState: %v, err: %v, expected jobid: %v, jobState: %v, err: %v", test.desc, jobid, jobState, err, test.expectedJobid, test.expectedJobState, test.expectedErr) } diff --git a/test/e2e/driver/blob_csi_driver.go b/test/e2e/driver/blob_csi_driver.go index aace41a39..c7e989f41 100644 --- a/test/e2e/driver/blob_csi_driver.go +++ b/test/e2e/driver/blob_csi_driver.go @@ -39,7 +39,7 @@ func InitBlobCSIDriver() PVTestDriver { } } -func (d *blobCSIDriver) GetProvisionStorageClass(parameters map[string]string, mountOptions []string, reclaimPolicy *v1.PersistentVolumeReclaimPolicy, bindingMode *storagev1.VolumeBindingMode, allowedTopologyValues []string, namespace string) *storagev1.StorageClass { +func (d *blobCSIDriver) GetProvisionStorageClass(parameters map[string]string, mountOptions []string, reclaimPolicy *v1.PersistentVolumeReclaimPolicy, bindingMode *storagev1.VolumeBindingMode, _ []string, namespace string) *storagev1.StorageClass { provisioner := d.driverName generateName := fmt.Sprintf("%s-%s-sc-", namespace, provisioner) return getStorageClass(generateName, provisioner, parameters, mountOptions, reclaimPolicy, bindingMode, nil) diff --git a/test/e2e/testsuites/specs.go b/test/e2e/testsuites/specs.go index e785decc6..7479985a8 100644 --- a/test/e2e/testsuites/specs.go +++ b/test/e2e/testsuites/specs.go @@ -91,7 +91,7 @@ type DataSource struct { Name string } -func (pod *PodDetails) SetupWithCSIInlineVolumes(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, secretName, shareName string, readOnly bool) (*TestPod, []func(context.Context)) { +func (pod *PodDetails) SetupWithCSIInlineVolumes(client clientset.Interface, namespace *v1.Namespace, _ driver.DynamicPVTestDriver, secretName, shareName string, readOnly bool) (*TestPod, []func(context.Context)) { tpod := NewTestPod(client, namespace, pod.Cmd) cleanupFuncs := make([]func(ctx context.Context), 0) for n, v := range pod.Volumes { From 2c8311599c5998af4dc416daa962ef79c1ae91ed Mon Sep 17 00:00:00 2001 From: umagnus Date: Mon, 20 Nov 2023 08:32:58 +0000 Subject: [PATCH 2/2] clean up parm in func --- test/e2e/testsuites/dynamically_provisioned_inline_volume.go | 2 +- test/e2e/testsuites/specs.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/testsuites/dynamically_provisioned_inline_volume.go b/test/e2e/testsuites/dynamically_provisioned_inline_volume.go index b30d29157..4f8db2135 100644 --- a/test/e2e/testsuites/dynamically_provisioned_inline_volume.go +++ b/test/e2e/testsuites/dynamically_provisioned_inline_volume.go @@ -41,7 +41,7 @@ func (t *DynamicallyProvisionedInlineVolumeTest) Run(ctx context.Context, client for _, pod := range t.Pods { var tpod *TestPod var cleanup []func(context.Context) - tpod, cleanup = pod.SetupWithCSIInlineVolumes(client, namespace, t.CSIDriver, t.SecretName, t.ContainerName, t.ReadOnly) + tpod, cleanup = pod.SetupWithCSIInlineVolumes(client, namespace, t.SecretName, t.ContainerName, t.ReadOnly) // defer must be called here for resources not get removed before using them for i := range cleanup { diff --git a/test/e2e/testsuites/specs.go b/test/e2e/testsuites/specs.go index 7479985a8..fe997b802 100644 --- a/test/e2e/testsuites/specs.go +++ b/test/e2e/testsuites/specs.go @@ -91,7 +91,7 @@ type DataSource struct { Name string } -func (pod *PodDetails) SetupWithCSIInlineVolumes(client clientset.Interface, namespace *v1.Namespace, _ driver.DynamicPVTestDriver, secretName, shareName string, readOnly bool) (*TestPod, []func(context.Context)) { +func (pod *PodDetails) SetupWithCSIInlineVolumes(client clientset.Interface, namespace *v1.Namespace, secretName, shareName string, readOnly bool) (*TestPod, []func(context.Context)) { tpod := NewTestPod(client, namespace, pod.Cmd) cleanupFuncs := make([]func(ctx context.Context), 0) for n, v := range pod.Volumes {