Minor bug with removing container name if import fails. Fixed.

This commit is contained in:
Gregory Kurtzer
2021-03-06 18:32:18 -08:00
parent 431c6d6891
commit dcea5ece28
2 changed files with 3 additions and 2 deletions

View File

@@ -109,14 +109,14 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
err = container.ImportDocker(uri, name, sCtx)
if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not import image: %s\n", err)
_ = container.DeleteSource(uri)
_ = container.DeleteSource(name)
os.Exit(1)
}
} else if util.IsDir(uri) {
err := container.ImportDirectory(uri, name)
if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not import image: %s\n", err)
_ = container.DeleteSource(uri)
_ = container.DeleteSource(name)
os.Exit(1)
}
}