From 3eaeac46d293705dadc6cc4d05b93448b3e3abf0 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 3 Feb 2023 15:39:00 +0100 Subject: [PATCH] use canonical os.TempDir --- Makefile | 3 +-- internal/app/wwctl/container/exec/child/main.go | 3 +-- internal/app/wwctl/container/exec/main.go | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 33120e66..6363b653 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ endif TFTPDIR ?= /var/lib/tftpboot # Warewulf directory paths -VARLIST += WWCLIENTDIR WWCONFIGDIR WWPROVISIONDIR WWOVERLAYDIR WWCHROOTDIR WWTFTPDIR WWDOCDIR WWDATADIR TMPDIR +VARLIST += WWCLIENTDIR WWCONFIGDIR WWPROVISIONDIR WWOVERLAYDIR WWCHROOTDIR WWTFTPDIR WWDOCDIR WWDATADIR WWCONFIGDIR := $(SYSCONFDIR)/$(WAREWULF) WWPROVISIONDIR := $(SRVDIR)/$(WAREWULF) WWOVERLAYDIR := $(LOCALSTATEDIR)/$(WAREWULF)/overlays @@ -76,7 +76,6 @@ WWTFTPDIR := $(TFTPDIR)/$(WAREWULF) WWDOCDIR := $(DOCDIR)/$(WAREWULF) WWDATADIR := $(DATADIR)/$(WAREWULF) WWCLIENTDIR ?= /warewulf -TMPDIR ?= /var/tmp # auto installed tooling TOOLS_DIR := .tools diff --git a/internal/app/wwctl/container/exec/child/main.go b/internal/app/wwctl/container/exec/child/main.go index b7bff3b6..bf32ad17 100644 --- a/internal/app/wwctl/container/exec/child/main.go +++ b/internal/app/wwctl/container/exec/child/main.go @@ -11,7 +11,6 @@ import ( "strings" "syscall" - "github.com/hpcng/warewulf/internal/pkg/buildconfig" "github.com/hpcng/warewulf/internal/pkg/container" "github.com/hpcng/warewulf/internal/pkg/node" "github.com/hpcng/warewulf/internal/pkg/overlay" @@ -44,7 +43,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { lowerObjects := checkMountPoints(containerName, mountPts) if len(lowerObjects) != 0 { if tempDir == "" { - tempDir, err = os.MkdirTemp(buildconfig.TMPDIR(), "overlay") + tempDir, err = os.MkdirTemp(os.TempDir(), "overlay") if err != nil { wwlog.Warn("couldn't create temp dir for overlay", err) lowerObjects = []string{} diff --git a/internal/app/wwctl/container/exec/main.go b/internal/app/wwctl/container/exec/main.go index 7e974b9e..bc622de2 100644 --- a/internal/app/wwctl/container/exec/main.go +++ b/internal/app/wwctl/container/exec/main.go @@ -11,7 +11,6 @@ import ( "syscall" "time" - "github.com/hpcng/warewulf/internal/pkg/buildconfig" "github.com/hpcng/warewulf/internal/pkg/container" "github.com/hpcng/warewulf/internal/pkg/util" "github.com/hpcng/warewulf/internal/pkg/wwlog" @@ -24,7 +23,7 @@ fork off a process with a new PID space func runContainedCmd(args []string) error { var err error if tempDir == "" { - tempDir, err = os.MkdirTemp(buildconfig.TMPDIR(), "overlay") + tempDir, err = os.MkdirTemp(os.TempDir(), "overlay") if err != nil { wwlog.Warn("couldn't create temp dir for overlay", err) }