Renamed vnfs to container, finished VNFS and kernel refactoring

This commit is contained in:
Gregory Kurtzer
2020-12-06 00:47:00 -08:00
parent 0095b55624
commit 8c11c2b304
44 changed files with 143 additions and 504 deletions

View File

@@ -2,9 +2,9 @@ package set
import (
"fmt"
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/vnfs"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
@@ -44,17 +44,17 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
if SetVnfs != "" {
if vnfs.ValidSource(SetVnfs) == true {
imageFile := vnfs.ImageFile(SetVnfs)
if SetContainer != "" {
if container.ValidSource(SetContainer) == true {
imageFile := container.ImageFile(SetContainer)
if util.IsFile(imageFile) == false {
wwlog.Printf(wwlog.ERROR, "VNFS has not been built: %s\n", SetVnfs)
wwlog.Printf(wwlog.ERROR, "Container has not been built: %s\n", SetContainer)
if SetForce == false {
os.Exit(1)
}
}
} else {
wwlog.Printf(wwlog.ERROR, "VNFS does not exist: %s\n", SetVnfs)
wwlog.Printf(wwlog.ERROR, "Container does not exist: %s\n", SetContainer)
if SetForce == false {
os.Exit(1)
}
@@ -74,10 +74,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
}
if SetVnfs != "" {
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting vnfs to: %s\n", n.Id.Get(), SetVnfs)
if SetContainer != "" {
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting container name to: %s\n", n.Id.Get(), SetContainer)
n.Vnfs.Set(SetVnfs)
n.ContainerName.Set(SetContainer)
err := nodeDB.NodeUpdate(n)
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)