From 5cd63097baa8f72ecb153656084c96361d3701fe Mon Sep 17 00:00:00 2001 From: Eric Weber Date: Fri, 11 Sep 2020 16:31:03 -0500 Subject: [PATCH] Don't attempt to detach an FC device if we don't know its name --- pkg/volume/fc/attacher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/volume/fc/attacher.go b/pkg/volume/fc/attacher.go index a9252286412..fe4ac941ba4 100644 --- a/pkg/volume/fc/attacher.go +++ b/pkg/volume/fc/attacher.go @@ -165,6 +165,11 @@ func (detacher *fcDetacher) UnmountDevice(deviceMountPath string) error { if err != nil { return fmt.Errorf("fc: failed to unmount: %s\nError: %v", deviceMountPath, err) } + // GetDeviceNameFromMount from above returns an empty string if deviceMountPath is not a mount point + // There is no need to DetachDisk if this is the case (and DetachDisk will throw an error if we attempt) + if devName == "" { + return nil + } unMounter := volumeSpecToUnmounter(detacher.mounter) err = detacher.manager.DetachDisk(*unMounter, devName) if err != nil {