Skip to content

Commit df231f9

Browse files
authored
Handle stale LUKS mappers for NVMe
This commit enhances Trident's CSI node stage and unstage operations to handle stale mapper devices for LUKS-encrypted NVMe devices.
1 parent d771e94 commit df231f9

File tree

20 files changed

+864
-336
lines changed

20 files changed

+864
-336
lines changed

frontend/csi/node_helpers/kubernetes/plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 NetApp, Inc. All Rights Reserved.
1+
// Copyright 2025 NetApp, Inc. All Rights Reserved.
22

33
package kubernetes
44

@@ -214,13 +214,13 @@ func (h *helper) RemovePublishedPath(ctx context.Context, volumeID, pathToRemove
214214

215215
volTrackingInfo, err := h.ReadTrackingInfo(ctx, volumeID)
216216
if err != nil {
217-
return fmt.Errorf("failed to read the tracking file; %v", err)
217+
return fmt.Errorf("failed to read the tracking file; %w", err)
218218
}
219219

220220
delete(volTrackingInfo.PublishedPaths, pathToRemove)
221221

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

226226
h.publishedPaths[volumeID] = volTrackingInfo.PublishedPaths

frontend/csi/node_server.go

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@ func (p *Plugin) nodeExpandVolume(
644644
devicePath := publishInfo.DevicePath
645645
if convert.ToBool(publishInfo.LUKSEncryption) {
646646
if !luks.IsLegacyDevicePath(devicePath) {
647-
devicePath, err = p.devices.GetLUKSDeviceForMultipathDevice(devicePath)
647+
devicePath, err = p.devices.GetLUKSDevicePathForVolume(ctx, volumeId)
648648
if err != nil {
649649
Logc(ctx).WithFields(LogFields{
650650
"volumeId": volumeId,
651651
"publishedPath": publishInfo.DevicePath,
652-
}).WithError(err).Error("Failed to get LUKS device path from device path.")
652+
}).WithError(err).Error("Failed to get LUKS device path for volume.")
653653
return status.Error(codes.Internal, err.Error())
654654
}
655655
}
@@ -1468,15 +1468,18 @@ func (p *Plugin) nodeUnstageFCPVolume(
14681468
publishInfo.DevicePath = dmPath
14691469
}
14701470
} else {
1471-
// If not using luks legacy device path we need to find the LUKS mapper device
1472-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(publishInfo.DevicePath)
1471+
// If not using luks legacy device path we need to find the LUKS mapper device.
1472+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
14731473
if err != nil {
1474-
if !errors.IsNotFoundError(err) {
1475-
Logc(ctx).WithFields(fields).WithError(err).Warn(
1476-
"Could not determine LUKS device path from multipath device. " +
1477-
"Continuing with device removal.")
1474+
// If the LUKS device is not found, the functional difference is negligible to unstage.
1475+
// But it may be useful to log at different levels for observability.
1476+
log := Logc(ctx).WithFields(fields).WithError(err)
1477+
if errors.IsNotFoundError(err) {
1478+
log.Warn("Failed to get LUKS device path for volume.")
1479+
} else {
1480+
log.Debug("Could not determine LUKS device path for volume.")
14781481
}
1479-
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
1482+
log.Debug("Continuing with device removal.")
14801483
}
14811484
}
14821485
err = p.devices.EnsureLUKSDeviceClosedWithMaxWaitLimit(ctx, luksMapperPath)
@@ -1519,11 +1522,10 @@ func (p *Plugin) nodeUnstageFCPVolume(
15191522
"multipathDevice": deviceInfo.MultipathDevice,
15201523
}
15211524

1522-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(deviceInfo.MultipathDevice)
1525+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
15231526
if err != nil {
15241527
if !errors.IsNotFoundError(err) {
1525-
Logc(ctx).WithFields(fields).
1526-
WithError(err).Error("Failed to get LUKS device path from multipath device.")
1528+
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from multipath device.")
15271529
return err
15281530
}
15291531
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
@@ -1995,7 +1997,7 @@ func (p *Plugin) nodeUnstageISCSIVolume(
19951997
if convert.ToBool(publishInfo.LUKSEncryption) {
19961998
var err error
19971999
var luksMapperPath string
1998-
fields := LogFields{"device": publishInfo.DevicePath}
2000+
fields := LogFields{"device": publishInfo.DevicePath, "volume": req.GetVolumeId()}
19992001
// Set device path to dm device to correctly verify legacy volumes.
20002002
if luks.IsLegacyDevicePath(publishInfo.DevicePath) {
20012003
luksMapperPath = publishInfo.DevicePath
@@ -2009,17 +2011,22 @@ func (p *Plugin) nodeUnstageISCSIVolume(
20092011
publishInfo.DevicePath = dmPath
20102012
}
20112013
} else {
2012-
// If not using luks legacy device path we need to find the LUKS mapper device
2013-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(publishInfo.DevicePath)
2014+
// Use the volume ID to get the LUKS mapper path.
2015+
// This should always work if the mapper is still present.
2016+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
20142017
if err != nil {
2015-
if !errors.IsNotFoundError(err) {
2016-
Logc(ctx).WithFields(fields).WithError(err).Warn(
2017-
"Could not determine LUKS device path from multipath device. " +
2018-
"Continuing with device removal.")
2018+
// If the LUKS device is not found, the functional difference is negligible to unstage.
2019+
// But it may be useful to log at different levels for observability.
2020+
log := Logc(ctx).WithFields(fields).WithError(err)
2021+
if errors.IsNotFoundError(err) {
2022+
log.Warn("Failed to get LUKS device path for volume.")
2023+
} else {
2024+
log.Debug("Could not determine LUKS device path for volume.")
20192025
}
2020-
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
2026+
log.Debug("Continuing with device removal.")
20212027
}
20222028
}
2029+
20232030
err = p.devices.EnsureLUKSDeviceClosedWithMaxWaitLimit(ctx, luksMapperPath)
20242031
if err != nil {
20252032
Logc(ctx).WithError(err).Debug("Unable to remove LUKS device. Continuing with tracking file removal.")
@@ -2070,7 +2077,7 @@ func (p *Plugin) nodeUnstageISCSIVolume(
20702077
"multipathDevice": deviceInfo.MultipathDevice,
20712078
}
20722079

2073-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(deviceInfo.MultipathDevice)
2080+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
20742081
if err != nil {
20752082
if !errors.IsNotFoundError(err) {
20762083
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from multipath device.")
@@ -3073,7 +3080,7 @@ func (p *Plugin) nodeUnstageNVMeVolume(
30733080
return nil, fmt.Errorf("failed to get NVMe device; %v", err)
30743081
}
30753082

3076-
var devicePath string
3083+
devicePath := publishInfo.DevicePath
30773084
if nvmeDev != nil {
30783085
devicePath = nvmeDev.GetPath()
30793086
}
@@ -3086,10 +3093,19 @@ func (p *Plugin) nodeUnstageNVMeVolume(
30863093
"publishedPath": publishInfo.DevicePath,
30873094
}
30883095

3089-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(devicePath)
3096+
// Use the volume ID to get the LUKS mapper path.
3097+
// This should always work if the mapper is still present.
3098+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
30903099
if err != nil {
3091-
Logc(ctx).WithFields(fields).WithError(err).Debug("Failed to get LUKS device path from device path. " +
3092-
"Device may already be removed.")
3100+
// If the LUKS device is not found, the functional difference is negligible to unstage.
3101+
// But it may be useful to log at different levels for observability.
3102+
log := Logc(ctx).WithFields(fields).WithError(err)
3103+
if errors.IsNotFoundError(err) {
3104+
log.Warn("Failed to get LUKS device path for volume.")
3105+
} else {
3106+
log.Debug("Could not determine LUKS device path for volume.")
3107+
}
3108+
log.Debug("Continuing with device removal.")
30933109
}
30943110

30953111
if luksMapperPath != "" {

frontend/csi/node_server_test.go

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
21312131
getDeviceClient: func() devices.Devices {
21322132
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
21332133
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2134-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2134+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
21352135
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).Return(nil)
21362136
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
21372137
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
@@ -2178,7 +2178,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
21782178
getDeviceClient: func() devices.Devices {
21792179
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
21802180
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2181-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2181+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
21822182
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
21832183
Return(nil)
21842184
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
@@ -2223,7 +2223,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
22232223
getDeviceClient: func() devices.Devices {
22242224
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
22252225
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2226-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2226+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
22272227
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
22282228
Return(fmt.Errorf("mock error"))
22292229
return mockDeviceClient
@@ -2242,7 +2242,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
22422242
getDeviceClient: func() devices.Devices {
22432243
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
22442244
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2245-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2245+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
22462246
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
22472247
Return(nil)
22482248
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
@@ -2317,7 +2317,8 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23172317
return mockDeviceClient
23182318
},
23192319
},
2320-
"SAN: iSCSI unstage: GetLUKSDeviceForMultipathDevice error": {
2320+
// mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2321+
"SAN: iSCSI unstage: GetLUKSDevicePathForVolume error": {
23212322
assertError: assert.Error,
23222323
request: NewNodeUnstageVolumeRequestBuilder().Build(),
23232324
publishInfo: NewVolumePublishInfoBuilder(TypeiSCSIVolumePublishInfo).WithLUKSEncryption("true").Build(),
@@ -2337,8 +2338,8 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23372338
getDeviceClient: func() devices.Devices {
23382339
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23392340
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2340-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", fmt.Errorf(
2341-
"mock error"))
2341+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(),
2342+
gomock.Any()).Return(mockDevicePath, errors.New("mock error"))
23422343
return mockDeviceClient
23432344
},
23442345
},
@@ -2358,7 +2359,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23582359
getDeviceClient: func() devices.Devices {
23592360
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23602361
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2361-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2362+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
23622363
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
23632364
Return(nil)
23642365
return mockDeviceClient
@@ -2392,7 +2393,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23922393
getDeviceClient: func() devices.Devices {
23932394
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23942395
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2395-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2396+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
23962397
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
23972398
Return(nil)
23982399
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
@@ -11936,7 +11937,7 @@ func TestNodeExpandVolume(t *testing.T) {
1193611937
},
1193711938
getDeviceClient: func() devices.Devices {
1193811939
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
11939-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New(""))
11940+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return("", errors.New(""))
1194011941
return mockDeviceClient
1194111942
},
1194211943
expErrCode: codes.Internal,
@@ -11984,7 +11985,9 @@ func TestNodeExpandVolume(t *testing.T) {
1198411985
},
1198511986
getDeviceClient: func() devices.Devices {
1198611987
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
11987-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
11988+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
11989+
gomock.Any(), gomock.Any(),
11990+
).Return("x/device-path", nil).AnyTimes()
1198811991
return mockDeviceClient
1198911992
},
1199011993
expErrCode: codes.InvalidArgument,
@@ -12032,7 +12035,9 @@ func TestNodeExpandVolume(t *testing.T) {
1203212035
},
1203312036
getDeviceClient: func() devices.Devices {
1203412037
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12035-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
12038+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12039+
gomock.Any(), gomock.Any(),
12040+
).Return("x/device-path", nil).AnyTimes()
1203612041
return mockDeviceClient
1203712042
},
1203812043
expErrCode: codes.InvalidArgument,
@@ -12080,7 +12085,9 @@ func TestNodeExpandVolume(t *testing.T) {
1208012085
},
1208112086
getDeviceClient: func() devices.Devices {
1208212087
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12083-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
12088+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12089+
gomock.Any(), gomock.Any(),
12090+
).Return("x/device-path", nil).AnyTimes()
1208412091
return mockDeviceClient
1208512092
},
1208612093
expErrCode: codes.Internal,
@@ -12523,7 +12530,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1252312530
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
1252412531
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1252512532
gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
12526-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New("")).AnyTimes()
12533+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12534+
gomock.Any(), gomock.Any(),
12535+
).Return("", errors.New("")).AnyTimes()
1252712536
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
1252812537
return mockDeviceClient
1252912538
},
@@ -12710,7 +12719,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1271012719
},
1271112720
getDeviceClient: func() devices.Devices {
1271212721
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12713-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New("")).AnyTimes()
12722+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12723+
gomock.Any(), gomock.Any(),
12724+
).Return("", errors.New("")).AnyTimes()
1271412725
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1271512726
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1271612727
// mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
@@ -12758,7 +12769,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1275812769
},
1275912770
getDeviceClient: func() devices.Devices {
1276012771
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12761-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12772+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12773+
gomock.Any(), gomock.Any(),
12774+
).Return("multipath-device", nil).AnyTimes()
1276212775
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1276312776
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1276412777
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
@@ -12807,7 +12820,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1280712820
},
1280812821
getDeviceClient: func() devices.Devices {
1280912822
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12810-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12823+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12824+
gomock.Any(), gomock.Any(),
12825+
).Return("multipath-device", nil).AnyTimes()
1281112826
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1281212827
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1281312828
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12855,7 +12870,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1285512870
},
1285612871
getDeviceClient: func() devices.Devices {
1285712872
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12858-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12873+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12874+
gomock.Any(), gomock.Any(),
12875+
).Return("multipath-device", nil).AnyTimes()
1285912876
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1286012877
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1286112878
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12903,7 +12920,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1290312920
},
1290412921
getDeviceClient: func() devices.Devices {
1290512922
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12906-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12923+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12924+
gomock.Any(), gomock.Any(),
12925+
).Return("multipath-device", nil).AnyTimes()
1290712926
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1290812927
gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
1290912928
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12952,7 +12971,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1295212971
},
1295312972
getDeviceClient: func() devices.Devices {
1295412973
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12955-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12974+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12975+
gomock.Any(), gomock.Any(),
12976+
).Return("multipath-device", nil).AnyTimes()
1295612977
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1295712978
gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1295812979
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()

0 commit comments

Comments
 (0)