diff --git a/pkg/fs/csiplugin/mount/info.go b/pkg/fs/csiplugin/mount/info.go index 65c144a7a..2e10f0606 100644 --- a/pkg/fs/csiplugin/mount/info.go +++ b/pkg/fs/csiplugin/mount/info.go @@ -25,7 +25,6 @@ import ( corev1 "k8s.io/api/core/v1" "github.com/PaddlePaddle/PaddleFlow/pkg/common/schema" - "github.com/PaddlePaddle/PaddleFlow/pkg/fs/client/ufs" "github.com/PaddlePaddle/PaddleFlow/pkg/fs/common" "github.com/PaddlePaddle/PaddleFlow/pkg/fs/csiplugin/csiconfig" "github.com/PaddlePaddle/PaddleFlow/pkg/fs/utils" @@ -210,18 +209,15 @@ func (mountInfo *Info) commonOptions() []string { options = append(options, "--log-level=debug") } - // s3 default mount permission - if mountInfo.FS.Type == common.S3Type { - if mountInfo.FS.PropertiesMap[common.FileMode] != "" { - options = append(options, fmt.Sprintf("--%s=%s", "file-mode", mountInfo.FS.PropertiesMap[common.FileMode])) - } else { - options = append(options, fmt.Sprintf("--%s=%v", "file-mode", ufs.DefaultFileMode)) - } - if mountInfo.FS.PropertiesMap[common.DirMode] != "" { - options = append(options, fmt.Sprintf("--%s=%s", "dir-mode", mountInfo.FS.PropertiesMap[common.DirMode])) - } else { - options = append(options, fmt.Sprintf("--%s=%v", "dir-mode", ufs.DefaultDirMode)) - } + if mountInfo.FS.PropertiesMap[common.FileMode] != "" { + options = append(options, fmt.Sprintf("--%s=%s", "file-mode", mountInfo.FS.PropertiesMap[common.FileMode])) + } else { + options = append(options, fmt.Sprintf("--%s=%v", "file-mode", "0777")) + } + if mountInfo.FS.PropertiesMap[common.DirMode] != "" { + options = append(options, fmt.Sprintf("--%s=%s", "dir-mode", mountInfo.FS.PropertiesMap[common.DirMode])) + } else { + options = append(options, fmt.Sprintf("--%s=%v", "dir-mode", "0777")) } return options } diff --git a/pkg/fs/csiplugin/mount/info_test.go b/pkg/fs/csiplugin/mount/info_test.go index ddb71ef37..53b6b9eda 100644 --- a/pkg/fs/csiplugin/mount/info_test.go +++ b/pkg/fs/csiplugin/mount/info_test.go @@ -232,7 +232,7 @@ func TestInfo_MountCmdArgs(t *testing.T) { CacheConfig: fsCache, TargetPath: targetPath, }, - want: "/home/paddleflow/pfs-fuse mount --mount-point=/home/paddleflow/mnt/storage --fs-id=fs-root-bos --sts=true --server=paddleflow-server:8999 --block-size=4096 --meta-cache-driver=disk --data-cache-path=/home/paddleflow/pfs-cache/data-cache --meta-cache-path=/home/paddleflow/pfs-cache/meta-cache", + want: "/home/paddleflow/pfs-fuse mount --mount-point=/home/paddleflow/mnt/storage --fs-id=fs-root-bos --sts=true --server=paddleflow-server:8999 --block-size=4096 --meta-cache-driver=disk --file-mode=0777 --dir-mode=0777 --data-cache-path=/home/paddleflow/pfs-cache/data-cache --meta-cache-path=/home/paddleflow/pfs-cache/meta-cache", }, { name: "test-bos-err",