Skip to content

Commit

Permalink
clean fake device also in removal of fake-attach block-mode vol
Browse files Browse the repository at this point in the history
Signed-off-by: Shi, Crane <[email protected]>
  • Loading branch information
CraneShiEMC committed Aug 15, 2023
1 parent b65bfef commit 3251da8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/node/volumemgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (m *VolumeManager) performVolumeRemoving(ctx context.Context, volume *volum
})

// For non-fs mode volume still in fake-attach status, we need to clean fake device
if volume.Annotations[fakeAttachVolumeAnnotation] == fakeAttachVolumeKey && volume.Spec.Mode == apiV1.ModeFS {
if volume.Annotations[fakeAttachVolumeAnnotation] == fakeAttachVolumeKey && volume.Spec.Mode != apiV1.ModeFS {
m.cleanFakeDevice(ll, volume)
}

Check warning on line 507 in pkg/node/volumemgr.go

View check run for this annotation

Codecov / codecov/patch

pkg/node/volumemgr.go#L506-L507

Added lines #L506 - L507 were not covered by tests

Expand Down Expand Up @@ -1399,8 +1399,8 @@ func (m *VolumeManager) createFakeDeviceIfNecessary(log *logrus.Entry, vol *volu
return "", err
}
} else {
blockDevices, err := m.listBlk.GetBlockDevices(fakeDevice)
if err != nil || len(blockDevices) == 0 {
devices, err := m.listBlk.GetBlockDevices(fakeDevice)
if err != nil || len(devices) == 0 {
var warnMsg string
if err != nil {
warnMsg = fmt.Sprintf("failed to get info of fake device %s with error: %s.", fakeDevice, err.Error())
Expand Down

0 comments on commit 3251da8

Please sign in to comment.