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:
2025-07-06 11:39:19 +02:00
parent e58948bb44
commit 09c2c86d59
6 changed files with 18 additions and 12 deletions

View File

@@ -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)
}