Don't rebuild overlays on overlay commands automatically
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/config"
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/overlay"
|
||||
"github.com/hpcng/warewulf/internal/pkg/util"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"github.com/pkg/errors"
|
||||
@@ -128,39 +127,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
i = path.Dir(i)
|
||||
}
|
||||
}
|
||||
fmt.Printf("Deleted from overlay: %s:%s:%s\n", overlayKind, overlayName, overlayPath)
|
||||
}
|
||||
|
||||
if !NoOverlayUpdate {
|
||||
n, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
nodes, err := n.FindAllNodes()
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not get node list: %s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
var updateNodes []node.NodeInfo
|
||||
|
||||
for _, node := range nodes {
|
||||
if overlayKind == "system" && node.SystemOverlay.Get() == overlayName {
|
||||
updateNodes = append(updateNodes, node)
|
||||
} else if overlayKind == "runtime" && node.RuntimeOverlay.Get() == overlayName {
|
||||
updateNodes = append(updateNodes, node)
|
||||
}
|
||||
}
|
||||
|
||||
if overlayKind == "system" {
|
||||
wwlog.Printf(wwlog.INFO, "Updating System Overlays...\n")
|
||||
return overlay.BuildSystemOverlay(updateNodes)
|
||||
} else if overlayKind == "runtime" {
|
||||
wwlog.Printf(wwlog.INFO, "Updating Runtime Overlays...\n")
|
||||
return overlay.BuildRuntimeOverlay(updateNodes)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user