mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
fix(host): wrap cephfs umount error (#21298)
This commit is contained in:
@@ -53,14 +53,15 @@ func (h cephFS) Mount(pod IPodInfo, ctrId string, vm *hostapi.ContainerVolumeMou
|
||||
func (h cephFS) Unmount(pod IPodInfo, ctrId string, vm *hostapi.ContainerVolumeMount) error {
|
||||
dir, err := h.GetRuntimeMountHostPath(pod, ctrId, vm)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrap(err, "GetRuntimeMountHostPath")
|
||||
}
|
||||
err = container_storage.Unmount(dir)
|
||||
if err != nil {
|
||||
if err := container_storage.Unmount(dir); err != nil {
|
||||
return errors.Wrapf(err, "unmount %s", dir)
|
||||
}
|
||||
_, err = procutils.NewRemoteCommandAsFarAsPossible("rm", "-f", dir).Output()
|
||||
return err
|
||||
if out, err := procutils.NewRemoteCommandAsFarAsPossible("rm", "-f", dir).Output(); err != nil {
|
||||
return errors.Wrapf(err, "rm -f %s: %s", dir, string(out))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func newCephFS() IVolumeMount {
|
||||
|
||||
Reference in New Issue
Block a user