Skip to content

Commit d980df9

Browse files
authored
Stale luks mappers revisited
1 parent fc86783 commit d980df9

File tree

9 files changed

+461
-201
lines changed

9 files changed

+461
-201
lines changed

frontend/csi/node_helpers/kubernetes/plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ func (h *helper) AddPublishedPath(ctx context.Context, volumeID, pathToAdd strin
192192

193193
volTrackingInfo, err := h.ReadTrackingInfo(ctx, volumeID)
194194
if err != nil {
195-
return fmt.Errorf("failed to read the tracking file; %v", err)
195+
return fmt.Errorf("failed to read the tracking file; %w", err)
196196
}
197197

198198
volTrackingInfo.PublishedPaths[pathToAdd] = struct{}{}
199199

200200
if err := h.WriteTrackingInfo(ctx, volumeID, volTrackingInfo); err != nil {
201-
return fmt.Errorf("failed to update the tracking file; %v", err)
201+
return fmt.Errorf("failed to update the tracking file; %w", err)
202202
}
203203

204204
h.publishedPaths[volumeID] = volTrackingInfo.PublishedPaths

frontend/csi/node_server.go

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,12 @@ func (p *Plugin) nodeExpandVolume(
645645
devicePath := publishInfo.DevicePath
646646
if convert.ToBool(publishInfo.LUKSEncryption) {
647647
if !luks.IsLegacyDevicePath(devicePath) {
648-
devicePath, err = p.devices.GetLUKSDevicePathForVolume(ctx, volumeId)
648+
devicePath, err = p.devices.GetLUKSDeviceForMultipathDevice(devicePath)
649649
if err != nil {
650650
Logc(ctx).WithFields(LogFields{
651651
"volumeId": volumeId,
652652
"publishedPath": publishInfo.DevicePath,
653-
}).WithError(err).Error("Failed to get LUKS device path for volume.")
653+
}).WithError(err).Error("Failed to get LUKS device path from device path.")
654654
return status.Error(codes.Internal, err.Error())
655655
}
656656
}
@@ -1460,18 +1460,15 @@ func (p *Plugin) nodeUnstageFCPVolume(
14601460
publishInfo.DevicePath = dmPath
14611461
}
14621462
} else {
1463-
// If not using luks legacy device path we need to find the LUKS mapper device.
1464-
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
1463+
// If not using LUKS legacy device path, we need to find the LUKS mapper device.
1464+
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(publishInfo.DevicePath)
14651465
if err != nil {
1466-
// If the LUKS device is not found, the functional difference is negligible to unstage.
1467-
// But it may be useful to log at different levels for observability.
1468-
log := Logc(ctx).WithFields(fields).WithError(err)
1469-
if errors.IsNotFoundError(err) {
1470-
log.Warn("Failed to get LUKS device path for volume.")
1471-
} else {
1472-
log.Debug("Could not determine LUKS device path for volume.")
1466+
if !errors.IsNotFoundError(err) {
1467+
Logc(ctx).WithFields(fields).WithError(err).Warn(
1468+
"Could not determine LUKS device path from multipath device. " +
1469+
"Continuing with device removal.")
14731470
}
1474-
log.Debug("Continuing with device removal.")
1471+
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
14751472
}
14761473
}
14771474
err = p.devices.EnsureLUKSDeviceClosedWithMaxWaitLimit(ctx, luksMapperPath)
@@ -1514,10 +1511,11 @@ func (p *Plugin) nodeUnstageFCPVolume(
15141511
"multipathDevice": deviceInfo.MultipathDevice,
15151512
}
15161513

1517-
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
1514+
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(deviceInfo.MultipathDevice)
15181515
if err != nil {
15191516
if !errors.IsNotFoundError(err) {
1520-
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from multipath device.")
1517+
Logc(ctx).WithFields(fields).
1518+
WithError(err).Error("Failed to get LUKS device path from multipath device.")
15211519
return err
15221520
}
15231521
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
@@ -1989,7 +1987,7 @@ func (p *Plugin) nodeUnstageISCSIVolume(
19891987
if convert.ToBool(publishInfo.LUKSEncryption) {
19901988
var err error
19911989
var luksMapperPath string
1992-
fields := LogFields{"device": publishInfo.DevicePath, "volume": req.GetVolumeId()}
1990+
fields := LogFields{"device": publishInfo.DevicePath}
19931991
// Set device path to dm device to correctly verify legacy volumes.
19941992
if luks.IsLegacyDevicePath(publishInfo.DevicePath) {
19951993
luksMapperPath = publishInfo.DevicePath
@@ -2003,22 +2001,17 @@ func (p *Plugin) nodeUnstageISCSIVolume(
20032001
publishInfo.DevicePath = dmPath
20042002
}
20052003
} else {
2006-
// Use the volume ID to get the LUKS mapper path.
2007-
// This should always work if the mapper is still present.
2008-
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
2004+
// If not using LUKS legacy device path, we need to find the LUKS mapper device.
2005+
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(publishInfo.DevicePath)
20092006
if err != nil {
2010-
// If the LUKS device is not found, the functional difference is negligible to unstage.
2011-
// But it may be useful to log at different levels for observability.
2012-
log := Logc(ctx).WithFields(fields).WithError(err)
2013-
if errors.IsNotFoundError(err) {
2014-
log.Warn("Failed to get LUKS device path for volume.")
2015-
} else {
2016-
log.Debug("Could not determine LUKS device path for volume.")
2007+
if !errors.IsNotFoundError(err) {
2008+
Logc(ctx).WithFields(fields).WithError(err).Warn(
2009+
"Could not determine LUKS device path from multipath device. " +
2010+
"Continuing with device removal.")
20172011
}
2018-
log.Debug("Continuing with device removal.")
2012+
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
20192013
}
20202014
}
2021-
20222015
err = p.devices.EnsureLUKSDeviceClosedWithMaxWaitLimit(ctx, luksMapperPath)
20232016
if err != nil {
20242017
Logc(ctx).WithError(err).Debug("Unable to remove LUKS device. Continuing with tracking file removal.")
@@ -2069,7 +2062,7 @@ func (p *Plugin) nodeUnstageISCSIVolume(
20692062
"multipathDevice": deviceInfo.MultipathDevice,
20702063
}
20712064

2072-
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
2065+
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(deviceInfo.MultipathDevice)
20732066
if err != nil {
20742067
if !errors.IsNotFoundError(err) {
20752068
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from multipath device.")
@@ -3085,19 +3078,14 @@ func (p *Plugin) nodeUnstageNVMeVolume(
30853078
"publishedPath": publishInfo.DevicePath,
30863079
}
30873080

3088-
// Use the volume ID to get the LUKS mapper path.
3089-
// This should always work if the mapper is still present.
3090-
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
3081+
luksMapperPath, err = p.devices.GetLUKSDevicePathForDevicePath(ctx, devicePath)
30913082
if err != nil {
3092-
// If the LUKS device is not found, the functional difference is negligible to unstage.
3093-
// But it may be useful to log at different levels for observability.
3094-
log := Logc(ctx).WithFields(fields).WithError(err)
3095-
if errors.IsNotFoundError(err) {
3096-
log.Warn("Failed to get LUKS device path for volume.")
3097-
} else {
3098-
log.Debug("Could not determine LUKS device path for volume.")
3083+
if !errors.IsNotFoundError(err) {
3084+
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from device path.")
3085+
return &csi.NodeUnstageVolumeResponse{}, err
30993086
}
3100-
log.Debug("Continuing with device removal.")
3087+
Logc(ctx).WithFields(fields).WithError(err).Debug("Failed to get LUKS device path from device path. " +
3088+
"Device may already be removed.")
31013089
}
31023090

31033091
if luksMapperPath != "" {

frontend/csi/node_server_test.go

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
21362136
getDeviceClient: func() devices.Devices {
21372137
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
21382138
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2139-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2139+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
21402140
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).Return(nil)
21412141
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
21422142
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
@@ -2183,7 +2183,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
21832183
getDeviceClient: func() devices.Devices {
21842184
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
21852185
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2186-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2186+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
21872187
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
21882188
Return(nil)
21892189
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
@@ -2228,7 +2228,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
22282228
getDeviceClient: func() devices.Devices {
22292229
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
22302230
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2231-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2231+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
22322232
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
22332233
Return(fmt.Errorf("mock error"))
22342234
return mockDeviceClient
@@ -2247,7 +2247,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
22472247
getDeviceClient: func() devices.Devices {
22482248
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
22492249
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2250-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2250+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
22512251
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
22522252
Return(nil)
22532253
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
@@ -2322,8 +2322,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23222322
return mockDeviceClient
23232323
},
23242324
},
2325-
// mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2326-
"SAN: iSCSI unstage: GetLUKSDevicePathForVolume error": {
2325+
"SAN: iSCSI unstage: GetLUKSDeviceForMultipathDevice error": {
23272326
assertError: assert.Error,
23282327
request: NewNodeUnstageVolumeRequestBuilder().Build(),
23292328
publishInfo: NewVolumePublishInfoBuilder(TypeiSCSIVolumePublishInfo).WithLUKSEncryption("true").Build(),
@@ -2343,8 +2342,8 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23432342
getDeviceClient: func() devices.Devices {
23442343
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23452344
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2346-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(),
2347-
gomock.Any()).Return(mockDevicePath, errors.New("mock error"))
2345+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", fmt.Errorf(
2346+
"mock error"))
23482347
return mockDeviceClient
23492348
},
23502349
},
@@ -2364,7 +2363,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23642363
getDeviceClient: func() devices.Devices {
23652364
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23662365
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2367-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2366+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
23682367
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
23692368
Return(nil)
23702369
return mockDeviceClient
@@ -2398,7 +2397,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23982397
getDeviceClient: func() devices.Devices {
23992398
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
24002399
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2401-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2400+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
24022401
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
24032402
Return(nil)
24042403
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
@@ -11936,7 +11935,7 @@ func TestNodeExpandVolume(t *testing.T) {
1193611935
},
1193711936
getDeviceClient: func() devices.Devices {
1193811937
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
11939-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return("", errors.New(""))
11938+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New(""))
1194011939
return mockDeviceClient
1194111940
},
1194211941
expErrCode: codes.Internal,
@@ -11983,9 +11982,7 @@ func TestNodeExpandVolume(t *testing.T) {
1198311982
},
1198411983
getDeviceClient: func() devices.Devices {
1198511984
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
11986-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
11987-
gomock.Any(), gomock.Any(),
11988-
).Return("x/device-path", nil).AnyTimes()
11985+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
1198911986
return mockDeviceClient
1199011987
},
1199111988
expErrCode: codes.InvalidArgument,
@@ -12033,9 +12030,7 @@ func TestNodeExpandVolume(t *testing.T) {
1203312030
},
1203412031
getDeviceClient: func() devices.Devices {
1203512032
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12036-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12037-
gomock.Any(), gomock.Any(),
12038-
).Return("x/device-path", nil).AnyTimes()
12033+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
1203912034
return mockDeviceClient
1204012035
},
1204112036
expErrCode: codes.InvalidArgument,
@@ -12083,9 +12078,7 @@ func TestNodeExpandVolume(t *testing.T) {
1208312078
},
1208412079
getDeviceClient: func() devices.Devices {
1208512080
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12086-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12087-
gomock.Any(), gomock.Any(),
12088-
).Return("x/device-path", nil).AnyTimes()
12081+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
1208912082
return mockDeviceClient
1209012083
},
1209112084
expErrCode: codes.Internal,
@@ -12528,9 +12521,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1252812521
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
1252912522
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1253012523
gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
12531-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12532-
gomock.Any(), gomock.Any(),
12533-
).Return("", errors.New("")).AnyTimes()
12524+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New("")).AnyTimes()
1253412525
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
1253512526
return mockDeviceClient
1253612527
},
@@ -12717,9 +12708,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1271712708
},
1271812709
getDeviceClient: func() devices.Devices {
1271912710
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12720-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12721-
gomock.Any(), gomock.Any(),
12722-
).Return("", errors.New("")).AnyTimes()
12711+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New("")).AnyTimes()
1272312712
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1272412713
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1272512714
// mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
@@ -12767,9 +12756,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1276712756
},
1276812757
getDeviceClient: func() devices.Devices {
1276912758
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12770-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12771-
gomock.Any(), gomock.Any(),
12772-
).Return("multipath-device", nil).AnyTimes()
12759+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
1277312760
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1277412761
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1277512762
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
@@ -12818,9 +12805,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1281812805
},
1281912806
getDeviceClient: func() devices.Devices {
1282012807
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12821-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12822-
gomock.Any(), gomock.Any(),
12823-
).Return("multipath-device", nil).AnyTimes()
12808+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
1282412809
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1282512810
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1282612811
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12868,9 +12853,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1286812853
},
1286912854
getDeviceClient: func() devices.Devices {
1287012855
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12871-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12872-
gomock.Any(), gomock.Any(),
12873-
).Return("multipath-device", nil).AnyTimes()
12856+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
1287412857
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1287512858
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1287612859
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12918,9 +12901,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1291812901
},
1291912902
getDeviceClient: func() devices.Devices {
1292012903
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12921-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12922-
gomock.Any(), gomock.Any(),
12923-
).Return("multipath-device", nil).AnyTimes()
12904+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
1292412905
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1292512906
gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
1292612907
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12969,9 +12950,7 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1296912950
},
1297012951
getDeviceClient: func() devices.Devices {
1297112952
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12972-
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12973-
gomock.Any(), gomock.Any(),
12974-
).Return("multipath-device", nil).AnyTimes()
12953+
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
1297512954
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1297612955
gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1297712956
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()

0 commit comments

Comments
 (0)