fix(permission): globalize and fixes
Permission alert frop OpenGrep is wrong, as the directory must use 0755. To make things working and to ease futur changes, I set the default permission in a constant.
This commit is contained in:
@@ -3,6 +3,7 @@ package generator
|
||||
import (
|
||||
"fmt"
|
||||
"katenary/generator/labels"
|
||||
"katenary/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -25,7 +26,7 @@ services:
|
||||
}
|
||||
composeFile := filepath.Join(tmpDir, "compose.yaml")
|
||||
|
||||
os.MkdirAll(tmpDir, 0755)
|
||||
os.MkdirAll(tmpDir, utils.DirectoryPermission)
|
||||
if err := os.WriteFile(composeFile, []byte(composeFileContent), 0644); err != nil {
|
||||
t.Log(err)
|
||||
}
|
||||
@@ -73,7 +74,7 @@ services:
|
||||
}
|
||||
composeFile := filepath.Join(tmpDir, "compose.yaml")
|
||||
|
||||
os.MkdirAll(tmpDir, 0755)
|
||||
os.MkdirAll(tmpDir, utils.DirectoryPermission)
|
||||
if err := os.WriteFile(composeFile, []byte(composeFileContent), 0644); err != nil {
|
||||
t.Log(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user