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

@@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
`/sys/firmware/devicetree/base/serial-number`
- Replace slice in templates with sprig substr. #1093
- Fix an invalid format issue for the GitHub nightly build action. #1258
- Return non-zero exit code on overlay build failure #1393
## v4.5.7, 2024-09-11

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