use yaml/v3 and don't export Nodes

introduced wwbool and don't export
Nodes and NodeConfs. This requires new
explict Yaml (un)marshaling as the standard
marshaller won't touch these fields

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-12-20 15:50:15 +01:00
committed by Jonathon Anderson
parent ac6cd69ca6
commit 5bd4fd4712
12 changed files with 470 additions and 196 deletions

View File

@@ -18,9 +18,10 @@ func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err err
return func(cmd *cobra.Command, args []string) error {
// remove the default network as the all network values are assigned
// to this network
if !node.ObjectIsEmpty(vars.nodeConf.NetDevs["UNDEF"]) {
if !node.ObjectIsEmpty(vars.nodeConf.NetDevs["UNDEF"]) || len(vars.nodeAdd.NetTagsAdd) > 0 {
netDev := *vars.nodeConf.NetDevs["UNDEF"]
vars.nodeConf.NetDevs[vars.nodeAdd.Net] = &netDev
vars.nodeConf.NetDevs[vars.nodeAdd.Net].Tags = vars.nodeAdd.NetTagsAdd
}
delete(vars.nodeConf.NetDevs, "UNDEF")
if vars.nodeAdd.FsName != "" {