From a666d452bf8644705c6d693a2439b83683b312cd Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 31 May 2021 12:08:01 +0530 Subject: [PATCH] cephfs: return GRPC error in NodeGetVolumeStats in case of failure return GRPC error to the caller. Signed-off-by: Madhu Rajanna --- internal/cephfs/nodeserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cephfs/nodeserver.go b/internal/cephfs/nodeserver.go index 6206a87ff..5013bc7cf 100644 --- a/internal/cephfs/nodeserver.go +++ b/internal/cephfs/nodeserver.go @@ -344,5 +344,5 @@ func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVo return csicommon.FilesystemNodeGetVolumeStats(ctx, targetPath) } - return nil, fmt.Errorf("targetpath %q is not a directory or device", targetPath) + return nil, status.Errorf(codes.InvalidArgument, "targetpath %q is not a directory or device", targetPath) }