From 80c92475b09dd68ceb5416c34d11eee003a6f68a Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Thu, 12 May 2022 11:51:00 +0200 Subject: [PATCH] added backwards compatibilty for default --- internal/pkg/node/constructors.go | 4 +++- internal/pkg/node/datastructure.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index cb30d06a..6dd00bb1 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -167,7 +167,8 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) { n.NetDevs[devname].Type.Set(netdev.Type) n.NetDevs[devname].OnBoot.Set(netdev.OnBoot) n.NetDevs[devname].Primary.Set(netdev.Primary) - // for just one netdev, it is always the default + n.NetDevs[devname].Primary.Set(netdev.Default) // backwards compatibility + // for just one netdev, it is always the primary if len(node.NetDevs) == 1 { n.NetDevs[devname].Primary.Set("true") } @@ -377,6 +378,7 @@ func (config *nodeYaml) FindAllProfiles() ([]NodeInfo, error) { p.NetDevs[devname].Type.Set(netdev.Type) p.NetDevs[devname].OnBoot.Set(netdev.OnBoot) p.NetDevs[devname].Primary.Set(netdev.Primary) + p.NetDevs[devname].Primary.Set(netdev.Default) // backwards compatibility // The following should not be set in a profile. if netdev.Ipaddr != "" { diff --git a/internal/pkg/node/datastructure.go b/internal/pkg/node/datastructure.go index feb88c46..62408a86 100644 --- a/internal/pkg/node/datastructure.go +++ b/internal/pkg/node/datastructure.go @@ -76,6 +76,7 @@ type NetDevs struct { Netmask string `yaml:"netmask,omitempty"` Gateway string `yaml:"gateway,omitempty"` Primary string `yaml:"primary,omitempty"` + Default string `yaml:"default,omitempty"` /* backward compatibility */ Tags map[string]string `yaml:"tags,omitempty"` }