Return error code if overlay build fails

Signed-off-by: Tobias Ribizel <mail@ribizel.de>
This commit is contained in:
Tobias Ribizel
2024-09-15 01:41:26 +02:00
parent 5db22a630e
commit 7692babd76
2 changed files with 4 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package build
import (
"errors"
"fmt"
"os"
"strings"
@@ -77,7 +78,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
if BuildHost && controller.Warewulf.EnableHostOverlay {
err := overlay.BuildHostOverlay()
if err != nil {
wwlog.Warn("host overlay could not be built: %s", err)
return errors.New(fmt.Sprintf("host overlay could not be built: %s", err))
}
}
@@ -89,7 +90,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if err != nil {
wwlog.Warn("Some overlays failed to be generated: %s", err)
return errors.New(fmt.Sprintf("Some overlays failed to be generated: %s", err))
}
}
return nil