change network hadnling

This commit is contained in:
Christian Goll
2022-07-12 10:42:05 +02:00
parent c8d70e23ad
commit 59141a6dac
6 changed files with 190 additions and 285 deletions

View File

@@ -1,6 +1,7 @@
package set
import (
"errors"
"fmt"
"github.com/hpcng/warewulf/internal/pkg/api/node"
@@ -10,10 +11,16 @@ import (
)
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
OptionStrMap, haveNetname := node.AddNetname(OptionStrMap)
if !haveNetname {
return errors.New("A netname must be given for any network related configuration\n")
}
realMap := make(map[string]string)
for key, val := range OptionStrMap {
realMap[key] = *val
}
set := wwapiv1.NodeSetParameter{
OptionsStrMap: realMap,
NetdevDelete: SetNetDevDel,