From 9607b9e807f8839a2b4e84587589548f17e35cff Mon Sep 17 00:00:00 2001 From: Tanggui Bian Date: Thu, 24 Aug 2023 16:29:54 +0800 Subject: [PATCH] Remove the execute permission from the directory Signed-off-by: Tanggui Bian --- operator/pkg/tasks/init/crd.go | 2 +- operator/pkg/util/util.go | 2 +- pkg/karmadactl/cmdinit/kubernetes/deploy.go | 2 +- pkg/karmadactl/cmdinit/kubernetes/deploy_test.go | 2 +- pkg/karmadactl/cmdinit/utils/util.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/operator/pkg/tasks/init/crd.go b/operator/pkg/tasks/init/crd.go index 9d2b7772bb05..27b0246353a1 100644 --- a/operator/pkg/tasks/init/crd.go +++ b/operator/pkg/tasks/init/crd.go @@ -86,7 +86,7 @@ func runCrdsDownload(r workflow.RunData) error { return err } if !exist { - if err := os.MkdirAll(crdsDir, 0755); err != nil { + if err := os.MkdirAll(crdsDir, 0700); err != nil { return err } } diff --git a/operator/pkg/util/util.go b/operator/pkg/util/util.go index 509ec81b8f79..f4128cdca732 100644 --- a/operator/pkg/util/util.go +++ b/operator/pkg/util/util.go @@ -98,7 +98,7 @@ func Unpack(file, targetPath string) error { switch header.Typeflag { case tar.TypeDir: - if err := os.Mkdir(targetPath+"/"+header.Name, 0755); err != nil { + if err := os.Mkdir(targetPath+"/"+header.Name, 0700); err != nil { return err } case tar.TypeReg: diff --git a/pkg/karmadactl/cmdinit/kubernetes/deploy.go b/pkg/karmadactl/cmdinit/kubernetes/deploy.go index 7fe9794bee6b..89c7893680b9 100644 --- a/pkg/karmadactl/cmdinit/kubernetes/deploy.go +++ b/pkg/karmadactl/cmdinit/kubernetes/deploy.go @@ -219,7 +219,7 @@ func initializeDirectory(path string) error { return err } } - if err := os.MkdirAll(path, os.FileMode(0o755)); err != nil { + if err := os.MkdirAll(path, os.FileMode(0700)); err != nil { return fmt.Errorf("failed to create directory: %s, error: %v", path, err) } diff --git a/pkg/karmadactl/cmdinit/kubernetes/deploy_test.go b/pkg/karmadactl/cmdinit/kubernetes/deploy_test.go index a0f39648b75b..647551870e6d 100644 --- a/pkg/karmadactl/cmdinit/kubernetes/deploy_test.go +++ b/pkg/karmadactl/cmdinit/kubernetes/deploy_test.go @@ -34,7 +34,7 @@ func Test_initializeDirectory(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if tt.createPathInAdvance { - if err := os.MkdirAll("tmp", os.FileMode(0755)); err != nil { + if err := os.MkdirAll("tmp", os.FileMode(0700)); err != nil { t.Errorf("create test directory failed in advance:%v", err) } } diff --git a/pkg/karmadactl/cmdinit/utils/util.go b/pkg/karmadactl/cmdinit/utils/util.go index a1cd4dc5dd33..d2a95920cc28 100644 --- a/pkg/karmadactl/cmdinit/utils/util.go +++ b/pkg/karmadactl/cmdinit/utils/util.go @@ -94,7 +94,7 @@ func DeCompress(file, targetPath string) error { switch header.Typeflag { case tar.TypeDir: - if err := os.Mkdir(targetPath+"/"+header.Name, 0755); err != nil { + if err := os.Mkdir(targetPath+"/"+header.Name, 0700); err != nil { return err } case tar.TypeReg: