mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #94781 from ejweber/fc-attacher-empty-devname
Don't attempt to detach an FC device if we don't know its name
This commit is contained in:
commit
796f9d89ba
@ -165,6 +165,11 @@ func (detacher *fcDetacher) UnmountDevice(deviceMountPath string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("fc: failed to unmount: %s\nError: %v", deviceMountPath, err)
|
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)
|
unMounter := volumeSpecToUnmounter(detacher.mounter)
|
||||||
err = detacher.manager.DetachDisk(*unMounter, devName)
|
err = detacher.manager.DetachDisk(*unMounter, devName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user