cephfs: return GRPC error in NodeGetVolumeStats

in case of failure return GRPC error to the caller.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-05-31 12:08:01 +05:30 committed by mergify[bot]
parent 81809500be
commit a666d452bf

View File

@ -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)
}