Removed unnecessary files

This commit is contained in:
Gregory Kurtzer
2021-04-23 19:38:36 -07:00
parent 79d2f2c9e8
commit 77bc2c5817
3 changed files with 0 additions and 140 deletions

View File

@@ -1,13 +0,0 @@
package main
import (
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/overlay"
)
func main() {
nodeDB, _ := node.New()
nodes, _ := nodeDB.FindAllNodes()
// wwlog.SetLevel(wwlog.DEBUG)
overlay.OverlayBuild(nodes, "runtime")
}

View File

@@ -1,89 +0,0 @@
package build
import (
"os"
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/kernel"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/spf13/cobra"
)
func CobraRunE(cmd *cobra.Command, args []string) error {
var nodes []node.NodeInfo
showHelp := true
n, err := node.New()
if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err)
os.Exit(1)
}
if len(args) > 0 {
var err error
nodes, err = n.SearchByName(args[0])
if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not find nodes for search term: %s\n", args[0])
os.Exit(1)
}
} else {
var err error
nodes, err = n.FindAllNodes()
if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not get list of nodes: %s\n", err)
os.Exit(1)
}
}
if buildVnfs == true || buildAll == true {
set := make(map[string]int)
showHelp = false
wwlog.Printf(wwlog.INFO, "Building VNFS images...\n")
for _, node := range nodes {
set[node.Vnfs.Get()]++
}
for e := range set {
container.Build(e, buildForce)
}
}
if buildKernel == true || buildAll == true {
set := make(map[string]int)
showHelp = false
wwlog.Printf(wwlog.INFO, "Building Kernel images...\n")
for _, node := range nodes {
set[node.KernelVersion.Get()]++
}
for e := range set {
kernel.Build(e)
}
}
if buildSystemOverlay == true || buildAll == true {
wwlog.Printf(wwlog.INFO, "Building System Overlays...\n")
showHelp = false
// overlay.SystemBuild(nodes, buildForce)
}
if buildRuntimeOverlay == true || buildAll == true {
wwlog.Printf(wwlog.INFO, "Building Runtime Overlays...n")
showHelp = false
// overlay.RuntimeBuild(nodes, buildForce)
}
if showHelp == true {
cmd.Usage()
os.Exit(1)
}
return nil
}

View File

@@ -1,38 +0,0 @@
package build
import (
"github.com/spf13/cobra"
)
var (
baseCmd = &cobra.Command{
Use: "build",
Short: "Warewulf build subcommand",
Long: "Warewulf build is used to build VNFS, kernel, and system-overlay objects for\n" +
"provisioning. The default usage will be to build and/or update anything\n" +
"that seems to be needed.",
RunE: CobraRunE,
}
buildVnfs bool
buildKernel bool
buildRuntimeOverlay bool
buildSystemOverlay bool
buildAll bool
buildForce bool
)
func init() {
baseCmd.PersistentFlags().BoolVarP(&buildVnfs, "container", "V", false, "Build and/or update VNFS images.")
baseCmd.PersistentFlags().BoolVarP(&buildKernel, "kernel", "K", false, "Build and/or update Kernel images.")
baseCmd.PersistentFlags().BoolVarP(&buildRuntimeOverlay, "runtime", "R", false, "Build and/or update runtime overlays")
baseCmd.PersistentFlags().BoolVarP(&buildSystemOverlay, "system", "S", false, "Build and/or update system overlays")
baseCmd.PersistentFlags().BoolVarP(&buildAll, "all", "A", false, "Build and/or update all components")
baseCmd.PersistentFlags().BoolVarP(&buildForce, "force", "f", false, "Force build even if nothing has been updated.")
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}