cephfs: return internal server error

if it is an error from the IsMountPoint
function and the error is not IsNotExist return
it as a internal server error.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-06-07 11:10:16 +05:30 committed by mergify[bot]
parent 46f1ab9e99
commit 4e2c4ef704

View File

@ -271,7 +271,7 @@ func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
util.DebugLog(ctx, "targetPath: %s has already been deleted", targetPath) util.DebugLog(ctx, "targetPath: %s has already been deleted", targetPath)
return &csi.NodeUnpublishVolumeResponse{}, nil return &csi.NodeUnpublishVolumeResponse{}, nil
} }
return nil, status.Error(codes.NotFound, err.Error()) return nil, status.Error(codes.Internal, err.Error())
} }
if !isMnt { if !isMnt {
if err = os.RemoveAll(targetPath); err != nil { if err = os.RemoveAll(targetPath); err != nil {
@ -318,7 +318,7 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
util.DebugLog(ctx, "targetPath: %s has already been deleted", stagingTargetPath) util.DebugLog(ctx, "targetPath: %s has already been deleted", stagingTargetPath)
return &csi.NodeUnstageVolumeResponse{}, nil return &csi.NodeUnstageVolumeResponse{}, nil
} }
return nil, status.Error(codes.NotFound, err.Error()) return nil, status.Error(codes.Internal, err.Error())
} }
if !isMnt { if !isMnt {
return &csi.NodeUnstageVolumeResponse{}, nil return &csi.NodeUnstageVolumeResponse{}, nil