WIP: Add initial support of IPv6#1219
Conversation
Signed-off-by: Chris Chiu <chris.chiu@suse.com>
There was a problem hiding this comment.
Pull request overview
This PR adds initial IPv6 support to the Harvester installer, allowing users to configure IPv6 addresses and gateways for both management network interfaces and Virtual IP (VIP) settings. This is a work-in-progress implementation addressing issue #9812.
Changes:
- Added IPv6 method selection (DHCP/Static) and configuration fields for management network interfaces
- Added IPv6 VIP support with validation to prevent conflicts with management network
- Updated NetworkManager connection templates to support IPv6 configuration
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/console/install_panels.go | Added IPv6 network method selection, IPv6 address/gateway input panels, and IPv6 VIP configuration with validation logic |
| pkg/console/constant.go | Added panel and label constants for IPv6-related UI elements |
| pkg/config/templates/nm-vlan.nmconnection | Updated VLAN NetworkManager template to support IPv6 methods (auto/manual/disabled) |
| pkg/config/templates/nm-bridge.nmconnection | Updated bridge NetworkManager template to support IPv6 methods (auto/manual/disabled) |
| pkg/config/cos.go | Added IPv6 fields to bridge network configuration |
| pkg/config/config.go | Added IPv6 configuration fields to Network and Install structs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return nil | ||
| } | ||
| // Should we check conflict with mgmt IPv6? | ||
| if vipIPv6 == mgmtNetwork.IPv6IP { |
There was a problem hiding this comment.
The comparison between vipIPv6 and mgmtNetwork.IPv6IP may not work correctly because mgmtNetwork.IPv6IP contains a CIDR notation (as set on line 2016), while vipIPv6 is parsed as a plain IP address. This will cause the comparison to fail even when the IP addresses are actually the same. Extract the IP address from the CIDR before comparison, similar to how it's done in the IPv6 address validation (lines 2009-2010).
| if vipIPv6 == mgmtNetwork.IPv6IP { | |
| mgmtIPv6 := mgmtNetwork.IPv6IP | |
| if strings.Contains(mgmtIPv6, "/") { | |
| if prefix, err := netip.ParsePrefix(mgmtIPv6); err == nil { | |
| mgmtIPv6 = prefix.Addr().String() | |
| } else { | |
| // Best-effort: strip CIDR suffix even if parsing failed | |
| mgmtIPv6 = strings.SplitN(mgmtIPv6, "/", 2)[0] | |
| } | |
| } | |
| if vipIPv6 == mgmtIPv6 { |
| } | ||
|
|
||
| if vipIPv6 != "" { | ||
| if net.ParseIP(vipIPv6) == nil { |
There was a problem hiding this comment.
The validation does not verify that the parsed IP is actually an IPv6 address. net.ParseIP accepts both IPv4 and IPv6 addresses. Add a check similar to lines 2013-2015 to ensure the address is IPv6: check if ip.To4() != nil and return an error if it's IPv4.
| if net.ParseIP(vipIPv6) == nil { | |
| ip := net.ParseIP(vipIPv6) | |
| if ip == nil || ip.To4() != nil { |
Problem:
harvester/harvester#9812
Solution:
It's now an intermediate solution in harvester installer.
Related Issue(s):
Test plan:
Additional documentation or context