diff --git a/internal/csi-common/utils.go b/internal/csi-common/utils.go index 439796273..174488884 100644 --- a/internal/csi-common/utils.go +++ b/internal/csi-common/utils.go @@ -198,7 +198,7 @@ func FilesystemNodeGetVolumeStats(ctx context.Context, targetPath string) (*csi. if os.IsNotExist(err) { return nil, status.Errorf(codes.InvalidArgument, "targetpath %s does not exist", targetPath) } - return nil, err + return nil, status.Error(codes.Internal, err.Error()) } if !isMnt { return nil, status.Errorf(codes.InvalidArgument, "targetpath %s is not mounted", targetPath) diff --git a/internal/util/util.go b/internal/util/util.go index 5223afc7a..52b89fb6b 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -28,8 +28,6 @@ import ( "time" "golang.org/x/sys/unix" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/util/validation" "k8s.io/cloud-provider/volume/helpers" "k8s.io/utils/mount" @@ -276,7 +274,7 @@ func IsMountPoint(p string) (bool, error) { dummyMount := mount.New("") notMnt, err := dummyMount.IsLikelyNotMountPoint(p) if err != nil { - return false, status.Error(codes.Internal, err.Error()) + return false, err } return !notMnt, nil