Remove os.Umask from overlay.BuildOverlayIndir

Adds tests to ensure that the overlay image contains the correct permissions.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-12-23 09:47:28 -07:00
parent 1affdc1883
commit 53e5805fbe
7 changed files with 70 additions and 64 deletions

View File

@@ -10,7 +10,6 @@ import (
"path/filepath"
"regexp"
"strings"
"syscall"
"text/template"
"github.com/Masterminds/sprig/v3"
@@ -251,9 +250,6 @@ func BuildOverlayIndir(nodeData node.Node, overlayNames []string, outputDir stri
return fmt.Errorf("overlay names contains illegal characters: %v", overlayNames)
}
// Temporarily set umask to 0000, so directories in the overlay retain permissions
defer syscall.Umask(syscall.Umask(0))
wwlog.Verbose("Processing node/overlays: %s/%s", nodeData.Id(), strings.Join(overlayNames, ","))
for _, overlayName := range overlayNames {
wwlog.Verbose("Building overlay %s for node %s in %s", overlayName, nodeData.Id(), outputDir)