Skip to content

Commit 0cb47a9

Browse files
authored
Handle volume import mismatch when 2 GCNV Volumes have same name
1 parent a4fc3fa commit 0cb47a9

File tree

5 files changed

+158
-24
lines changed

5 files changed

+158
-24
lines changed

mocks/mock_storage_drivers/mock_gcp/mock_gcnvapi.go

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storage_drivers/gcp/gcnvapi/gcnv.go

+25-4
Original file line numberDiff line numberDiff line change
@@ -478,18 +478,18 @@ func (c Client) VolumeByName(ctx context.Context, name string) (*Volume, error)
478478
flexPoolsCount := c.flexPoolCount()
479479
locations := c.findAllLocationsFromCapacityPool(flexPoolsCount)
480480

481+
gcnvVolumes := make(map[string]*netapppb.Volume)
481482
var gcnvVolume *netapppb.Volume
482483
var err error
483484
// We iterate over a list of region and zones to check if the volume is in that region or zone.
484485
// We use this logic to reduce the number of API calls to the GCNV API
485486
for location := range locations {
486-
487487
req := &netapppb.GetVolumeRequest{
488488
Name: c.createVolumeID(location, name),
489489
}
490490
gcnvVolume, err = c.sdkClient.gcnv.GetVolume(sdkCtx, req)
491491
if gcnvVolume != nil {
492-
break
492+
gcnvVolumes[gcnvVolume.Name] = gcnvVolume
493493
} else if err != nil {
494494
if IsGCNVNotFoundError(err) {
495495
Logc(ctx).WithFields(logFields).Debugf("Volume not found in '%s' location.", location)
@@ -500,14 +500,19 @@ func (c Client) VolumeByName(ctx context.Context, name string) (*Volume, error)
500500
}
501501
}
502502

503-
if gcnvVolume == nil {
503+
if len(gcnvVolumes) == 0 {
504504
if IsGCNVNotFoundError(err) {
505505
return nil, errors.WrapWithNotFoundError(err, "volume '%s' not found", name)
506506
}
507507
return nil, err
508+
} else if len(gcnvVolumes) > 1 {
509+
return nil, errors.New("found multiple volumes with the same name in the given location")
508510
}
509511
Logd(ctx, c.config.StorageDriverName, c.config.DebugTraceFlags["api"]).
510512
WithFields(logFields).Debug("Found volume by name.")
513+
for _, volume := range gcnvVolumes {
514+
gcnvVolume = volume
515+
}
511516

512517
return c.newVolumeFromGCNVVolume(ctx, gcnvVolume)
513518
}
@@ -543,7 +548,7 @@ func (c Client) VolumeByID(ctx context.Context, id string) (*Volume, error) {
543548
}
544549

545550
Logd(ctx, c.config.StorageDriverName, c.config.DebugTraceFlags["api"]).
546-
WithFields(logFields).Trace("Fetching volume by id.")
551+
WithFields(logFields).Trace("Fetching volume by volumeID.")
547552

548553
sdkCtx, sdkCancel := context.WithTimeout(ctx, c.config.SDKTimeout)
549554
defer sdkCancel()
@@ -862,6 +867,22 @@ func (c Client) DeleteVolume(ctx context.Context, volume *Volume) error {
862867
return nil
863868
}
864869

870+
// VolumeByNameOrID retrieves a gcnv volume for import by volumeName or volumeID
871+
func (c Client) VolumeByNameOrID(ctx context.Context, volumeID string) (*Volume, error) {
872+
var volume *Volume
873+
var err error
874+
match := volumeNameRegex.FindStringSubmatch(volumeID)
875+
if match == nil {
876+
volume, err = c.VolumeByName(ctx, volumeID)
877+
} else {
878+
volume, err = c.VolumeByID(ctx, volumeID)
879+
}
880+
if err != nil {
881+
return nil, err
882+
}
883+
return volume, nil
884+
}
885+
865886
// ///////////////////////////////////////////////////////////////////////////////
866887
// Functions to retrieve and manage snapshots
867888
// ///////////////////////////////////////////////////////////////////////////////

storage_drivers/gcp/gcnvapi/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type GCNV interface {
3131
VolumeExistsByName(context.Context, string) (bool, *Volume, error)
3232
VolumeByID(context.Context, string) (*Volume, error)
3333
VolumeExistsByID(context.Context, string) (bool, *Volume, error)
34+
VolumeByNameOrID(context.Context, string) (*Volume, error)
3435
WaitForVolumeState(context.Context, *Volume, string, []string, time.Duration) (string, error)
3536
CreateVolume(context.Context, *VolumeCreateRequest) (*Volume, error)
3637
ModifyVolume(context.Context, *Volume, map[string]string, *string, *bool, *ExportRule) error

storage_drivers/gcp/gcp_gcnv.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1102,11 +1102,13 @@ func (d *NASStorageDriver) Import(ctx context.Context, volConfig *storage.Volume
11021102
}
11031103

11041104
// Get the volume
1105-
volume, err := d.API.VolumeByName(ctx, originalName)
1105+
volume, err := d.API.VolumeByNameOrID(ctx, originalName)
11061106
if err != nil {
11071107
return fmt.Errorf("could not find volume %s; %v", originalName, err)
11081108
}
1109-
1109+
if volume.State != gcnvapi.VolumeStateReady {
1110+
return fmt.Errorf("volume %s is in state %s and is not available", originalName, volume.State)
1111+
}
11101112
// Don't allow import for dual-protocol volume.
11111113
// For dual-protocol volume the ProtocolTypes has two values [NFSv3, CIFS]
11121114
if d.isDualProtocolVolume(volume) {
@@ -2118,7 +2120,7 @@ func (d *NASStorageDriver) GetVolumeForImport(ctx context.Context, volumeID stri
21182120
return nil, fmt.Errorf("could not update GCNV resource cache; %v", err)
21192121
}
21202122

2121-
filesystem, err := d.API.VolumeByName(ctx, volumeID)
2123+
filesystem, err := d.API.VolumeByNameOrID(ctx, volumeID)
21222124
if err != nil {
21232125
return nil, err
21242126
}

storage_drivers/gcp/gcp_gcnv_test.go

+112-17
Original file line numberDiff line numberDiff line change
@@ -3660,7 +3660,7 @@ func TestImport_Managed(t *testing.T) {
36603660
expectedUnixPermissions := "0770"
36613661

36623662
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3663-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3663+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
36643664
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
36653665

36663666
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, &expectedUnixPermissions, &snapshotDirAccess, nil).Return(nil).Times(1)
@@ -3675,6 +3675,43 @@ func TestImport_Managed(t *testing.T) {
36753675
assert.Equal(t, originalVolume.FullName, volConfig.InternalID, "internal ID not set on volConfig")
36763676
}
36773677

3678+
func TestImport_ManagedVolumeFullName(t *testing.T) {
3679+
mockAPI, driver := newMockGCNVDriver(t)
3680+
3681+
driver.Config.BackendName = "gcnv"
3682+
driver.Config.ServiceLevel = gcnvapi.ServiceLevelPremium
3683+
driver.Config.NASType = "nfs"
3684+
driver.Config.UnixPermissions = "0770"
3685+
3686+
err := driver.populateConfigurationDefaults(ctx, &driver.Config)
3687+
assert.NoError(t, err, "error occurred")
3688+
3689+
driver.initializeStoragePools(ctx)
3690+
driver.initializeTelemetry(ctx, gcnvapi.BackendUUID)
3691+
3692+
volConfig, originalVolume := getStructsForNFSImport(ctx, driver)
3693+
3694+
expectedLabels := driver.updateTelemetryLabels(ctx, originalVolume)
3695+
var snapshotDirAccess bool
3696+
originalFullName := "projects/123456789/locations/fake-location/volumes/testvol1"
3697+
expectedUnixPermissions := "0770"
3698+
3699+
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3700+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalFullName).Return(originalVolume, nil).Times(1)
3701+
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
3702+
3703+
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, &expectedUnixPermissions, &snapshotDirAccess, nil).Return(nil).Times(1)
3704+
3705+
mockAPI.EXPECT().WaitForVolumeState(ctx, originalVolume, gcnvapi.VolumeStateReady, []string{gcnvapi.VolumeStateError},
3706+
driver.defaultTimeout()).Return(gcnvapi.VolumeStateReady, nil).Times(1)
3707+
3708+
result := driver.Import(ctx, volConfig, originalFullName)
3709+
3710+
assert.NoError(t, result, "import failed")
3711+
assert.Equal(t, originalVolume.Name, volConfig.Name, "internal name mismatch")
3712+
assert.Equal(t, originalFullName, volConfig.InternalID, "internal ID not set on volConfig")
3713+
}
3714+
36783715
func TestImport_ManagedWithSnapshotDir(t *testing.T) {
36793716
mockAPI, driver := newMockGCNVDriver(t)
36803717

@@ -3699,7 +3736,7 @@ func TestImport_ManagedWithSnapshotDir(t *testing.T) {
36993736
snapshotDirAccess := true
37003737

37013738
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3702-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3739+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
37033740
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
37043741

37053742
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, &expectedUnixPermissions, &snapshotDirAccess, nil).Return(nil).Times(1)
@@ -3738,7 +3775,7 @@ func TestImport_ManagedWithSnapshotDirFalse(t *testing.T) {
37383775
snapshotDirAccess := false
37393776

37403777
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3741-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3778+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
37423779
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
37433780

37443781
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, &expectedUnixPermissions, &snapshotDirAccess, nil).Return(nil).Times(1)
@@ -3773,7 +3810,7 @@ func TestImport_ManagedWithInvalidSnapshotDirValue(t *testing.T) {
37733810
originalName := "importMe"
37743811

37753812
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3776-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3813+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
37773814
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
37783815

37793816
result := driver.Import(ctx, volConfig, originalName)
@@ -3802,7 +3839,7 @@ func TestImport_SMB_Managed(t *testing.T) {
38023839
originalName := "importMe"
38033840

38043841
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3805-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3842+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
38063843
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
38073844

38083845
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, nil, &snapshotDirAccess, nil).Return(nil).Times(1)
@@ -3837,7 +3874,7 @@ func TestImport_SMB_Failed(t *testing.T) {
38373874
originalName := "importMe"
38383875

38393876
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3840-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3877+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
38413878
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
38423879

38433880
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, nil, &snapshotDirAccess, nil).Return(errFailed).Times(1)
@@ -3868,7 +3905,7 @@ func TestImport_DualProtocolVolume(t *testing.T) {
38683905
originalName := "importMe"
38693906

38703907
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3871-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3908+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
38723909

38733910
result := driver.Import(ctx, volConfig, originalName)
38743911

@@ -3895,7 +3932,7 @@ func TestImport_CapacityPoolError(t *testing.T) {
38953932
originalName := "importMe"
38963933

38973934
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3898-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3935+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
38993936
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(errFailed).Times(1)
39003937

39013938
result := driver.Import(ctx, volConfig, originalName)
@@ -3924,7 +3961,7 @@ func TestImport_NotManaged(t *testing.T) {
39243961
originalName := "importMe"
39253962

39263963
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3927-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
3964+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
39283965
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
39293966

39303967
result := driver.Import(ctx, volConfig, originalName)
@@ -3934,6 +3971,36 @@ func TestImport_NotManaged(t *testing.T) {
39343971
assert.Equal(t, originalVolume.FullName, volConfig.InternalID, "internal ID not set on volConfig")
39353972
}
39363973

3974+
func TestImport_NotManagedVolumeFullName(t *testing.T) {
3975+
mockAPI, driver := newMockGCNVDriver(t)
3976+
3977+
driver.Config.BackendName = "gcnv"
3978+
driver.Config.ServiceLevel = gcnvapi.ServiceLevelPremium
3979+
driver.Config.NASType = "nfs"
3980+
driver.Config.UnixPermissions = "0770"
3981+
3982+
err := driver.populateConfigurationDefaults(ctx, &driver.Config)
3983+
assert.NoError(t, err, "error occurred")
3984+
3985+
driver.initializeStoragePools(ctx)
3986+
driver.initializeTelemetry(ctx, gcnvapi.BackendUUID)
3987+
3988+
volConfig, originalVolume := getStructsForNFSImport(ctx, driver)
3989+
3990+
volConfig.ImportNotManaged = true
3991+
originalFullName := "projects/123456789/locations/fake-location/volumes/testvol1"
3992+
3993+
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3994+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalFullName).Return(originalVolume, nil).Times(1)
3995+
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
3996+
3997+
result := driver.Import(ctx, volConfig, originalFullName)
3998+
3999+
assert.NoError(t, result, "import failed")
4000+
assert.Equal(t, originalVolume.Name, volConfig.Name, "internal name mismatch")
4001+
assert.Equal(t, originalFullName, volConfig.InternalID, "internal ID not set on volConfig")
4002+
}
4003+
39374004
func TestImport_DiscoveryFailed(t *testing.T) {
39384005
mockAPI, driver := newMockGCNVDriver(t)
39394006

@@ -3981,7 +4048,7 @@ func TestImport_NotFound(t *testing.T) {
39814048
originalName := "importMe"
39824049

39834050
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
3984-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(nil, errFailed).Times(1)
4051+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(nil, errFailed).Times(1)
39854052

39864053
result := driver.Import(ctx, volConfig, originalName)
39874054

@@ -3990,6 +4057,34 @@ func TestImport_NotFound(t *testing.T) {
39904057
assert.Equal(t, "", volConfig.InternalID, "internal ID set on volConfig")
39914058
}
39924059

4060+
func TestImport_DuplicateVolumes(t *testing.T) {
4061+
mockAPI, driver := newMockGCNVDriver(t)
4062+
4063+
driver.Config.BackendName = "gcnv"
4064+
driver.Config.ServiceLevel = gcnvapi.ServiceLevelPremium
4065+
driver.Config.NASType = "nfs"
4066+
driver.Config.UnixPermissions = "0770"
4067+
4068+
err := driver.populateConfigurationDefaults(ctx, &driver.Config)
4069+
assert.NoError(t, err, "error occurred")
4070+
4071+
driver.initializeStoragePools(ctx)
4072+
driver.initializeTelemetry(ctx, gcnvapi.BackendUUID)
4073+
4074+
volConfig, _ := getStructsForNFSImport(ctx, driver)
4075+
4076+
originalName := "importMe"
4077+
4078+
// Mock API to return an error indicating duplicate volumes
4079+
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
4080+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(nil, errors.New("found multiple volumes with the same name in the given location")).Times(1)
4081+
4082+
result := driver.Import(ctx, volConfig, originalName)
4083+
4084+
assert.Error(t, result, "expected error")
4085+
assert.Contains(t, result.Error(), "found multiple volumes with the same name in the given location", "unexpected error message")
4086+
}
4087+
39934088
func TestImport_InvalidUnixPermissions(t *testing.T) {
39944089
mockAPI, driver := newMockGCNVDriver(t)
39954090

@@ -4009,7 +4104,7 @@ func TestImport_InvalidUnixPermissions(t *testing.T) {
40094104
originalName := "importMe"
40104105

40114106
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
4012-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
4107+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
40134108
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
40144109

40154110
result := driver.Import(ctx, volConfig, originalName)
@@ -4041,7 +4136,7 @@ func TestImport_ModifyVolumeFailed(t *testing.T) {
40414136
snapshotDirAccess := false
40424137

40434138
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
4044-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
4139+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
40454140
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
40464141

40474142
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, &expectedUnixPermissions, &snapshotDirAccess, nil).Return(errFailed).Times(1)
@@ -4075,7 +4170,7 @@ func TestImport_VolumeWaitFailed(t *testing.T) {
40754170
snapshotDirAccess := false
40764171

40774172
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
4078-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
4173+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
40794174
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
40804175

40814176
mockAPI.EXPECT().ModifyVolume(ctx, originalVolume, expectedLabels, &expectedUnixPermissions, &snapshotDirAccess, nil).Return(nil).Times(1)
@@ -4109,7 +4204,7 @@ func TestImport_BackendVolumeMismatch(t *testing.T) {
41094204
originalName := "importMe"
41104205

41114206
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
4112-
mockAPI.EXPECT().VolumeByName(ctx, originalName).Return(originalVolume, nil).Times(1)
4207+
mockAPI.EXPECT().VolumeByNameOrID(ctx, originalName).Return(originalVolume, nil).Times(1)
41134208
mockAPI.EXPECT().EnsureVolumeInValidCapacityPool(ctx, originalVolume).Return(nil).Times(1)
41144209

41154210
result := driver.Import(ctx, volConfig, originalName)
@@ -6658,7 +6753,7 @@ func TestGCNVGetVolumeForImport(t *testing.T) {
66586753
}
66596754

66606755
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
6661-
mockAPI.EXPECT().VolumeByName(ctx, "testvol1").Return(volume, nil).Times(1)
6756+
mockAPI.EXPECT().VolumeByNameOrID(ctx, "testvol1").Return(volume, nil).Times(1)
66626757

66636758
result, resultErr := driver.GetVolumeForImport(ctx, "testvol1")
66646759

@@ -6683,7 +6778,7 @@ func TestGCNVGetVolumeForImport_VolumeNameWithPrefix(t *testing.T) {
66836778
}
66846779

66856780
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
6686-
mockAPI.EXPECT().VolumeByName(ctx, "testvol1").Return(volume, nil).Times(1)
6781+
mockAPI.EXPECT().VolumeByNameOrID(ctx, "testvol1").Return(volume, nil).Times(1)
66876782

66886783
result, resultErr := driver.GetVolumeForImport(ctx, "testvol1")
66896784

@@ -6715,7 +6810,7 @@ func TestGetVolumeForImport_GetFailed(t *testing.T) {
67156810
driver.Config.StoragePrefix = &storagePrefix
67166811

67176812
mockAPI.EXPECT().RefreshGCNVResources(ctx).Return(nil).Times(1)
6718-
mockAPI.EXPECT().VolumeByName(ctx, "testvol1").Return(nil, errFailed).Times(1)
6813+
mockAPI.EXPECT().VolumeByNameOrID(ctx, "testvol1").Return(nil, errFailed).Times(1)
67196814

67206815
result, resultErr := driver.GetVolumeForImport(ctx, "testvol1")
67216816

0 commit comments

Comments
 (0)