enable the build flag

Signed-off-by: jason yang <jasonyangshadow@gmail.com>
This commit is contained in:
jason yang
2023-12-12 17:29:50 -07:00
parent 231987ecfc
commit 5785d15497

View File

@@ -240,12 +240,14 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
}
}
wwlog.Info("Building container: %s", cip.Name)
err = container.Build(cip.Name, true)
if err != nil {
err = fmt.Errorf("could not build container %s: %s", cip.Name, err.Error())
wwlog.Error(err.Error())
return
if cip.Build {
wwlog.Info("Building container: %s", cip.Name)
err = container.Build(cip.Name, true)
if err != nil {
err = fmt.Errorf("could not build container %s: %s", cip.Name, err.Error())
wwlog.Error(err.Error())
return
}
}
if cip.Default {