From 9a28b2d7fb15966a265e507116b817ff8da28bc2 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 7 Jun 2024 14:55:14 +0200 Subject: [PATCH] copy.DirCopy is internal and needs Init Signed-off-by: Christian Goll --- CHANGELOG.md | 1 + internal/pkg/container/imprt.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c90135b5..5406e723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Correctly extract smbios asset key during Grub boot. #1291 - Refactor of `wwinit/init` to more properly address rootfs options. #1098 - Fix autodetected kernel sorting issue. #1332 +- Avoid panic on container import #1244 ## v4.5.7, 2024-09-11 diff --git a/internal/pkg/container/imprt.go b/internal/pkg/container/imprt.go index 38726dcf..e1ae82b0 100644 --- a/internal/pkg/container/imprt.go +++ b/internal/pkg/container/imprt.go @@ -7,6 +7,7 @@ import ( "github.com/containers/image/v5/types" "github.com/containers/storage/drivers/copy" + "github.com/containers/storage/pkg/reexec" "github.com/pkg/errors" warewulfconf "github.com/warewulf/warewulf/internal/pkg/config" @@ -67,7 +68,9 @@ func ImportDirectory(uri string, name string) error { if !util.IsFile(path.Join(uri, "/bin/sh")) { return errors.New("Source directory has no /bin/sh: " + uri) } - + if reexec.Init() { + return errors.New("couldn't init reexec") + } err = copy.DirCopy(uri, fullPath, copy.Content, true) if err != nil { return err