Skip to content

Commit fa25647

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 5c8452a commit fa25647

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
@@ -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.GetLUKSDeviceForMultipathDevice(devicePath)
648+
devicePath, err = p.devices.GetLUKSDevicePathForVolume(ctx, volumeId)
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 from device path.")
653+
}).WithError(err).Error("Failed to get LUKS device path for volume.")
654654
return status.Error(codes.Internal, err.Error())
655655
}
656656
}
@@ -1460,15 +1460,18 @@ 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.GetLUKSDeviceForMultipathDevice(publishInfo.DevicePath)
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())
14651465
if err != nil {
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.")
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.")
14701473
}
1471-
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
1474+
log.Debug("Continuing with device removal.")
14721475
}
14731476
}
14741477
err = p.devices.EnsureLUKSDeviceClosedWithMaxWaitLimit(ctx, luksMapperPath)
@@ -1511,11 +1514,10 @@ func (p *Plugin) nodeUnstageFCPVolume(
15111514
"multipathDevice": deviceInfo.MultipathDevice,
15121515
}
15131516

1514-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(deviceInfo.MultipathDevice)
1517+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
15151518
if err != nil {
15161519
if !errors.IsNotFoundError(err) {
1517-
Logc(ctx).WithFields(fields).
1518-
WithError(err).Error("Failed to get LUKS device path from multipath device.")
1520+
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from multipath device.")
15191521
return err
15201522
}
15211523
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
@@ -1987,7 +1989,7 @@ func (p *Plugin) nodeUnstageISCSIVolume(
19871989
if convert.ToBool(publishInfo.LUKSEncryption) {
19881990
var err error
19891991
var luksMapperPath string
1990-
fields := LogFields{"device": publishInfo.DevicePath}
1992+
fields := LogFields{"device": publishInfo.DevicePath, "volume": req.GetVolumeId()}
19911993
// Set device path to dm device to correctly verify legacy volumes.
19921994
if luks.IsLegacyDevicePath(publishInfo.DevicePath) {
19931995
luksMapperPath = publishInfo.DevicePath
@@ -2001,17 +2003,22 @@ func (p *Plugin) nodeUnstageISCSIVolume(
20012003
publishInfo.DevicePath = dmPath
20022004
}
20032005
} else {
2004-
// If not using luks legacy device path we need to find the LUKS mapper device
2005-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(publishInfo.DevicePath)
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())
20062009
if err != nil {
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.")
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.")
20112017
}
2012-
Logc(ctx).WithFields(fields).Info("No LUKS device path found from multipath device.")
2018+
log.Debug("Continuing with device removal.")
20132019
}
20142020
}
2021+
20152022
err = p.devices.EnsureLUKSDeviceClosedWithMaxWaitLimit(ctx, luksMapperPath)
20162023
if err != nil {
20172024
Logc(ctx).WithError(err).Debug("Unable to remove LUKS device. Continuing with tracking file removal.")
@@ -2062,7 +2069,7 @@ func (p *Plugin) nodeUnstageISCSIVolume(
20622069
"multipathDevice": deviceInfo.MultipathDevice,
20632070
}
20642071

2065-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(deviceInfo.MultipathDevice)
2072+
luksMapperPath, err = p.devices.GetLUKSDevicePathForVolume(ctx, req.GetVolumeId())
20662073
if err != nil {
20672074
if !errors.IsNotFoundError(err) {
20682075
Logc(ctx).WithFields(fields).WithError(err).Error("Failed to get LUKS device path from multipath device.")
@@ -3065,7 +3072,7 @@ func (p *Plugin) nodeUnstageNVMeVolume(
30653072
return nil, fmt.Errorf("failed to get NVMe device; %v", err)
30663073
}
30673074

3068-
var devicePath string
3075+
devicePath := publishInfo.DevicePath
30693076
if nvmeDev != nil {
30703077
devicePath = nvmeDev.GetPath()
30713078
}
@@ -3078,10 +3085,19 @@ func (p *Plugin) nodeUnstageNVMeVolume(
30783085
"publishedPath": publishInfo.DevicePath,
30793086
}
30803087

3081-
luksMapperPath, err = p.devices.GetLUKSDeviceForMultipathDevice(devicePath)
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())
30823091
if err != nil {
3083-
Logc(ctx).WithFields(fields).WithError(err).Debug("Failed to get LUKS device path from device path. " +
3084-
"Device may already be removed.")
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.")
3099+
}
3100+
log.Debug("Continuing with device removal.")
30853101
}
30863102

30873103
if luksMapperPath != "" {

frontend/csi/node_server_test.go

Lines changed: 41 additions & 20 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().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2139+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), 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().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2186+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), 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().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2231+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), 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().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2250+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
22512251
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
22522252
Return(nil)
22532253
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
@@ -2322,7 +2322,8 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23222322
return mockDeviceClient
23232323
},
23242324
},
2325-
"SAN: iSCSI unstage: GetLUKSDeviceForMultipathDevice error": {
2325+
// mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
2326+
"SAN: iSCSI unstage: GetLUKSDevicePathForVolume error": {
23262327
assertError: assert.Error,
23272328
request: NewNodeUnstageVolumeRequestBuilder().Build(),
23282329
publishInfo: NewVolumePublishInfoBuilder(TypeiSCSIVolumePublishInfo).WithLUKSEncryption("true").Build(),
@@ -2342,8 +2343,8 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23422343
getDeviceClient: func() devices.Devices {
23432344
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23442345
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2345-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", fmt.Errorf(
2346-
"mock error"))
2346+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(),
2347+
gomock.Any()).Return(mockDevicePath, errors.New("mock error"))
23472348
return mockDeviceClient
23482349
},
23492350
},
@@ -2363,7 +2364,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23632364
getDeviceClient: func() devices.Devices {
23642365
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23652366
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2366-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2367+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
23672368
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
23682369
Return(nil)
23692370
return mockDeviceClient
@@ -2397,7 +2398,7 @@ func TestNodeUnstageISCSIVolume(t *testing.T) {
23972398
getDeviceClient: func() devices.Devices {
23982399
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
23992400
mockDeviceClient.EXPECT().GetMultipathDeviceBySerial(gomock.Any(), gomock.Any())
2400-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return(mockDevicePath, nil)
2401+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return(mockDevicePath, nil)
24012402
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), mockDevicePath).
24022403
Return(nil)
24032404
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), mockDevicePath).Return(nil)
@@ -11935,7 +11936,7 @@ func TestNodeExpandVolume(t *testing.T) {
1193511936
},
1193611937
getDeviceClient: func() devices.Devices {
1193711938
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
11938-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New(""))
11939+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(gomock.Any(), gomock.Any()).Return("", errors.New(""))
1193911940
return mockDeviceClient
1194011941
},
1194111942
expErrCode: codes.Internal,
@@ -11982,7 +11983,9 @@ func TestNodeExpandVolume(t *testing.T) {
1198211983
},
1198311984
getDeviceClient: func() devices.Devices {
1198411985
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
11985-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
11986+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
11987+
gomock.Any(), gomock.Any(),
11988+
).Return("x/device-path", nil).AnyTimes()
1198611989
return mockDeviceClient
1198711990
},
1198811991
expErrCode: codes.InvalidArgument,
@@ -12030,7 +12033,9 @@ func TestNodeExpandVolume(t *testing.T) {
1203012033
},
1203112034
getDeviceClient: func() devices.Devices {
1203212035
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12033-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
12036+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12037+
gomock.Any(), gomock.Any(),
12038+
).Return("x/device-path", nil).AnyTimes()
1203412039
return mockDeviceClient
1203512040
},
1203612041
expErrCode: codes.InvalidArgument,
@@ -12078,7 +12083,9 @@ func TestNodeExpandVolume(t *testing.T) {
1207812083
},
1207912084
getDeviceClient: func() devices.Devices {
1208012085
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12081-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("x/device-path", nil).AnyTimes()
12086+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12087+
gomock.Any(), gomock.Any(),
12088+
).Return("x/device-path", nil).AnyTimes()
1208212089
return mockDeviceClient
1208312090
},
1208412091
expErrCode: codes.Internal,
@@ -12521,7 +12528,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1252112528
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
1252212529
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1252312530
gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
12524-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New("")).AnyTimes()
12531+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12532+
gomock.Any(), gomock.Any(),
12533+
).Return("", errors.New("")).AnyTimes()
1252512534
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
1252612535
return mockDeviceClient
1252712536
},
@@ -12708,7 +12717,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1270812717
},
1270912718
getDeviceClient: func() devices.Devices {
1271012719
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12711-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("", errors.New("")).AnyTimes()
12720+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12721+
gomock.Any(), gomock.Any(),
12722+
).Return("", errors.New("")).AnyTimes()
1271212723
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1271312724
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1271412725
// mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
@@ -12756,7 +12767,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1275612767
},
1275712768
getDeviceClient: func() devices.Devices {
1275812769
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12759-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12770+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12771+
gomock.Any(), gomock.Any(),
12772+
).Return("multipath-device", nil).AnyTimes()
1276012773
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1276112774
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1276212775
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
@@ -12805,7 +12818,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1280512818
},
1280612819
getDeviceClient: func() devices.Devices {
1280712820
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12808-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12821+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12822+
gomock.Any(), gomock.Any(),
12823+
).Return("multipath-device", nil).AnyTimes()
1280912824
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1281012825
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1281112826
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12853,7 +12868,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1285312868
},
1285412869
getDeviceClient: func() devices.Devices {
1285512870
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12856-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12871+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12872+
gomock.Any(), gomock.Any(),
12873+
).Return("multipath-device", nil).AnyTimes()
1285712874
// mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1285812875
// gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1285912876
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12901,7 +12918,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1290112918
},
1290212919
getDeviceClient: func() devices.Devices {
1290312920
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12904-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12921+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12922+
gomock.Any(), gomock.Any(),
12923+
).Return("multipath-device", nil).AnyTimes()
1290512924
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1290612925
gomock.Any(), gomock.Any()).Return(errors.New("")).AnyTimes()
1290712926
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosedWithMaxWaitLimit(gomock.Any(), gomock.Any()).Return(errors.MaxWaitExceededError("")).AnyTimes()
@@ -12950,7 +12969,9 @@ func TestNodeUnstageFCPVolume(t *testing.T) {
1295012969
},
1295112970
getDeviceClient: func() devices.Devices {
1295212971
mockDeviceClient := mock_devices.NewMockDevices(gomock.NewController(t))
12953-
mockDeviceClient.EXPECT().GetLUKSDeviceForMultipathDevice(gomock.Any()).Return("multipath-device", nil).AnyTimes()
12972+
mockDeviceClient.EXPECT().GetLUKSDevicePathForVolume(
12973+
gomock.Any(), gomock.Any(),
12974+
).Return("multipath-device", nil).AnyTimes()
1295412975
mockDeviceClient.EXPECT().RemoveMultipathDeviceMappingWithRetries(gomock.Any(), gomock.Any(),
1295512976
gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
1295612977
mockDeviceClient.EXPECT().EnsureLUKSDeviceClosed(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()

0 commit comments

Comments
 (0)