Remove unused/unneeded Ipv6net config

Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
This commit is contained in:
Timothy Middelkoop
2025-11-16 15:07:34 +00:00
parent 3868c72337
commit f9f8fe3673
3 changed files with 4 additions and 54 deletions

View File

@@ -29,7 +29,6 @@ type WarewulfYaml struct {
Ipaddr6 string `yaml:"ipaddr6,omitempty"`
Netmask string `yaml:"netmask,omitempty"`
Network string `yaml:"network,omitempty"`
Ipv6net string `yaml:"ipv6net,omitempty"`
Fqdn string `yaml:"fqdn,omitempty"`
Warewulf *WarewulfConf `yaml:"warewulf,omitempty"`
API *APIConf `yaml:"api,omitempty"`
@@ -141,11 +140,7 @@ func (conf *WarewulfYaml) Parse(data []byte, autodetect bool) error {
}
if conf.Ipaddr6 != "" {
if _, network, err := net.ParseCIDR(conf.Ipaddr6); err == nil {
if conf.Ipv6net == "" {
conf.Ipv6net = network.IP.String()
}
} else {
if _, _, err := net.ParseCIDR(conf.Ipaddr6); err != nil {
return fmt.Errorf("invalid ipv6 address: must use CIDR notation: %s", conf.Ipaddr6)
}
}

View File

@@ -153,53 +153,6 @@ ipaddr6: "2001:db8::1/64"
`,
result: `
ipaddr6: "2001:db8::1/64"
ipv6net: "2001:db8::"
warewulf:
autobuild overlays: true
grubboot: false
host overlay: true
port: 9873
secure: true
update interval: 60
nfs:
enabled: true
systemd name: nfsd
dhcp:
enabled: true
systemd name: dhcpd
template: default
image mounts:
- dest: /etc/resolv.conf
source: /etc/resolv.conf
ssh:
key types:
- ed25519
- ecdsa
- rsa
- dsa
tftp:
enabled: true
ipxe:
"00:00": undionly.kpxe
"00:07": ipxe-snponly-x86_64.efi
"00:09": ipxe-snponly-x86_64.efi
"00:0B": arm64-efi/snponly.efi
systemd name: tftp
api:
enabled: false
allowed subnets:
- 127.0.0.0/8
- ::1/128
`,
},
"ipv6 cidr conflict": {
input: `
ipaddr6: "2001:db8:1::1/64"
ipv6net: "2001:db8:2::"
`,
result: `
ipaddr6: "2001:db8:1::1/64"
ipv6net: "2001:db8:2::"
warewulf:
autobuild overlays: true
grubboot: false

View File

@@ -45,7 +45,9 @@ func (legacy *WarewulfYaml) Upgrade() (upgraded *config.WarewulfYaml) {
upgraded.Ipaddr6 = legacy.Ipaddr6
upgraded.Netmask = legacy.Netmask
upgraded.Network = legacy.Network
upgraded.Ipv6net = legacy.Ipv6net
if legacy.Ipv6net != "" {
logIgnore("Ipv6net", legacy.Ipv6net, "obsolete")
}
upgraded.Fqdn = legacy.Fqdn
if legacy.Warewulf != nil {
upgraded.Warewulf = legacy.Warewulf.Upgrade()