Skip to content

Comments

WIP: Add initial support of IPv6#1219

Open
mingshuoqiu wants to merge 1 commit intoharvester:masterfrom
mingshuoqiu:issue_9812
Open

WIP: Add initial support of IPv6#1219
mingshuoqiu wants to merge 1 commit intoharvester:masterfrom
mingshuoqiu:issue_9812

Conversation

@mingshuoqiu
Copy link
Contributor

Problem:

harvester/harvester#9812

Solution:

It's now an intermediate solution in harvester installer.

Related Issue(s):

Test plan:

Additional documentation or context

Signed-off-by: Chris Chiu <chris.chiu@suse.com>
Copilot AI review requested due to automatic review settings January 14, 2026 03:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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 {

Copilot uses AI. Check for mistakes.
}

if vipIPv6 != "" {
if net.ParseIP(vipIPv6) == nil {
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if net.ParseIP(vipIPv6) == nil {
ip := net.ParseIP(vipIPv6)
if ip == nil || ip.To4() != nil {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant