mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #92345 from brianpursley/unmount-handle-not-found
Make unmount device log warning and continue if mount path is not found
This commit is contained in:
commit
a730ad56b9
@ -835,8 +835,15 @@ func (og *operationGenerator) GenerateUnmountDeviceFunc(
|
||||
deviceMountPath, err :=
|
||||
volumeDeviceMounter.GetDeviceMountPath(deviceToDetach.VolumeSpec)
|
||||
if err != nil {
|
||||
// On failure, return error. Caller will log and retry.
|
||||
return deviceToDetach.GenerateError("GetDeviceMountPath failed", err)
|
||||
// On failure other than "does not exist", return error. Caller will log and retry.
|
||||
if !strings.Contains(err.Error(), "does not exist") {
|
||||
return deviceToDetach.GenerateError("GetDeviceMountPath failed", err)
|
||||
}
|
||||
// If the mount path could not be found, don't fail the unmount, but instead log a warning and proceed,
|
||||
// using the value from deviceToDetach.DeviceMountPath, so that the device can be marked as unmounted
|
||||
deviceMountPath = deviceToDetach.DeviceMountPath
|
||||
klog.Warningf(deviceToDetach.GenerateMsg(fmt.Sprintf(
|
||||
"GetDeviceMountPath failed, but unmount operation will proceed using deviceMountPath=%s: %v", deviceMountPath, err), ""))
|
||||
}
|
||||
refs, err := deviceMountableVolumePlugin.GetDeviceMountRefs(deviceMountPath)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user