mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-05-29 01:56:41 +00:00
rbd: use os.Remove to remove directory
using os.RemoveAll will remove everything in the director after the Umount we should be using os.Remove only to remove the empty directory Signed-off-by: Madhu Rajanna <madhupr007@gmail.com> (cherry picked from commit 39cc628adf1da1ab78f3aacfb7fe8f53e9a1fd29)
This commit is contained in:
parent
7e3c894c7a
commit
e1ba89b607
@ -937,7 +937,7 @@ func (ns *NodeServer) NodeUnpublishVolume(
|
||||
return nil, status.Error(codes.NotFound, err.Error())
|
||||
}
|
||||
if !isMnt {
|
||||
if err = os.RemoveAll(targetPath); err != nil {
|
||||
if err = os.Remove(targetPath); err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
@ -948,7 +948,7 @@ func (ns *NodeServer) NodeUnpublishVolume(
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
if err = os.RemoveAll(targetPath); err != nil {
|
||||
if err = os.Remove(targetPath); err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user