Files
warewulf/internal/pkg/container/config.go
Jonathon Anderson 70292276e2 Rename BaseConf.New to BaseConf.Get
Since BaseConf.New could return a cached BaseConf, rather than always
constructing a new struct, I've renamed it to Get to more accurately
reflect its use. A new New() method is called by Get and always
initializes a new struct.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00

30 lines
573 B
Go

package container
import (
"path"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
)
func SourceParentDir() string {
conf := warewulfconf.Get()
return conf.Paths.WWChrootdir
}
func SourceDir(name string) string {
return path.Join(SourceParentDir(), name)
}
func RootFsDir(name string) string {
return path.Join(SourceDir(name), "rootfs")
}
func ImageParentDir() string {
conf := warewulfconf.Get()
return path.Join(conf.Paths.WWProvisiondir, "container/")
}
func ImageFile(name string) string {
return path.Join(ImageParentDir(), name+".img")
}