Skip to content

Commit

Permalink
Remove the execute permission from the directory
Browse files Browse the repository at this point in the history
Signed-off-by: Tanggui Bian <softwarebtg@163.com>
  • Loading branch information
zishen committed Aug 24, 2023
1 parent c938785 commit c746971
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion operator/pkg/tasks/init/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, 0640); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/karmadactl/cmdinit/kubernetes/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(0o640)); err != nil {
return fmt.Errorf("failed to create directory: %s, error: %v", path, err)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/karmadactl/cmdinit/kubernetes/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(640)); err != nil {

Check failure on line 37 in pkg/karmadactl/cmdinit/kubernetes/deploy_test.go

View workflow job for this annotation

GitHub Actions / lint

SA9002: file mode '640' evaluates to 01200; did you mean '0640'? (staticcheck)
t.Errorf("create test directory failed in advance:%v", err)
}
}
Expand Down

0 comments on commit c746971

Please sign in to comment.