Add an Overlay type with helper methods

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-12-18 11:35:57 -07:00
committed by Christian Goll
parent 7d4b7ab432
commit c03dc9436b
14 changed files with 307 additions and 176 deletions

View File

@@ -14,8 +14,8 @@ import (
Creates '/etc/hosts' from the host template.
*/
func Hostfile() (err error) {
overlaySourceDir, _ := overlay.GetOverlay("host")
hostTemplate := path.Join(overlaySourceDir, "/etc/hosts.ww")
overlay_ := overlay.GetOverlay("host")
hostTemplate := path.Join(overlay_.Rootfs(), "/etc/hosts.ww")
if !(util.IsFile(hostTemplate)) {
return fmt.Errorf("'the overlay template '/etc/hosts.ww' does not exists in 'host' overlay")
}