From 4e2c4ef704c8873b5d5e52f53f8069f9bc0dda70 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 7 Jun 2021 11:10:16 +0530 Subject: [PATCH] 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 --- internal/cephfs/nodeserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cephfs/nodeserver.go b/internal/cephfs/nodeserver.go index ec125e833..cdc94ee75 100644 --- a/internal/cephfs/nodeserver.go +++ b/internal/cephfs/nodeserver.go @@ -271,7 +271,7 @@ func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu util.DebugLog(ctx, "targetPath: %s has already been deleted", targetPath) return &csi.NodeUnpublishVolumeResponse{}, nil } - return nil, status.Error(codes.NotFound, err.Error()) + return nil, status.Error(codes.Internal, err.Error()) } if !isMnt { 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) return &csi.NodeUnstageVolumeResponse{}, nil } - return nil, status.Error(codes.NotFound, err.Error()) + return nil, status.Error(codes.Internal, err.Error()) } if !isMnt { return &csi.NodeUnstageVolumeResponse{}, nil