- Updated `wwctl upgrade` to handle updates - Maintained `.Container` and `.ContainerName` in tstruct - Added `ContainerName()` methods to node and profile objects - Added `--container`, `-C` aliases to wwctl commands (`<node|profile> <add|set>`) - Added `wwctl container` alias - Added support for `container_exit.sh` if `image_exit.sh` is not found Signed-off-by: Jonathon Anderson <janderson@ciq.com>
34 lines
646 B
Go
34 lines
646 B
Go
package image
|
|
|
|
import (
|
|
"path"
|
|
|
|
warewulfconf "github.com/warewulf/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 RunDir(name string) string {
|
|
return path.Join(SourceDir(name), "run")
|
|
}
|
|
|
|
func ImageParentDir() string {
|
|
conf := warewulfconf.Get()
|
|
return path.Join(conf.Paths.WWProvisiondir, "image")
|
|
}
|
|
|
|
func ImageFile(name string) string {
|
|
return path.Join(ImageParentDir(), name+".img")
|
|
}
|