Files
warewulf/internal/pkg/image/config.go
Jonathon Anderson 45a690ca4e Rename "container" to "image"
- 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>
2025-01-19 05:54:19 -07:00

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