Skip to content

Commit

Permalink
Try to dump source before creating image
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti committed Mar 1, 2024
1 parent e56244d commit 6980fe5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func UnmountFileSystemImage(c v1.Config, img *v1.Image) error {
// can be used to determine the image size and the preload flag can be used to create an image
// including the root tree data.
func CreateFileSystemImage(c v1.Config, img *v1.Image, rootDir string, preload bool) error {
c.Logger.Infof("Creating image %s", img.File)
c.Logger.Infof("Creating image %s from rootDir %s", img.File, rootDir)
err := utils.MkdirAll(c.Fs, filepath.Dir(img.File), cnst.DirPerm)
if err != nil {
c.Logger.Errorf("failed creating directory for %s", img.File)
Expand Down Expand Up @@ -432,6 +432,11 @@ func DeployImage(c v1.Config, img *v1.Image) error {
transientTree := strings.TrimSuffix(img.File, filepath.Ext(img.File)) + ".imgTree"
if img.Source.IsDir() {
transientTree = img.Source.Value()
err = DumpSource(c, transientTree, img.Source)
if err != nil {
c.Logger.Errorf("failed dumping image tree: %v", err)
return err
}
} else if img.Source.IsFile() {
srcImg := &v1.Image{
File: img.Source.Value(),
Expand Down

0 comments on commit 6980fe5

Please sign in to comment.