-
Notifications
You must be signed in to change notification settings - Fork 246
Prefix on nicv6 support #3658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Prefix on nicv6 support #3658
Conversation
There was a problem hiding this 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 introduces changes to support Prefix on NICv6 by enhancing CNS and IPAM components to handle dualstack IP allocation and additional interface information.
- Updated CNS to consume MACAddress from the network container request.
- Refactored IP assignment logic to support multiple IP families and enhanced error messages.
- Updated IP config response processing and CNI result construction to include and deduplicate gateway IPs and interface MAC addresses.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
cns/restserver/util.go | Added MACAddress assignment to PodIpInfo to support NICv6 configuration. |
cns/restserver/ipam.go | Refactored IP allocation logic to support dual IP families and introduced generateAssignedIPKey helper. |
cns/restserver/internalapi_linux.go | Added IPv4 check to ensure SNAT rules are only applied to IPv4 addresses. |
cns/kubecontroller/nodenetworkconfig/conversion_linux.go | Updated NC request conversion to handle IPv6 gateway and MACAddress assignment. |
cns/NetworkContainerContract.go | Added GatewayIPv6Address field and IPFamily enum definitions. |
azure-ipam/ipconfig/ipconfig.go | Modified ProcessIPConfigsResp to parse and return gateway IPs for both IPv4 and IPv6. |
azure-ipam/ipam.go | Updated CNI result construction to include gateway IPs and deduplicate interface MAC addresses. |
Comments suppressed due to low confidence (1)
cns/restserver/ipam.go:1028
- [nitpick] Consider renaming 'numberOfIPs' to a more descriptive name such as 'requiredIPCount' to clarify that it represents the count based on IP families rather than just the number of NCs.
if numOfIPFamilies != 0 {
numberOfIPs = numOfIPFamilies
}
gatewayIP = net.ParseIP(resp.PodIPInfo[i].NetworkContainerPrimaryIPConfig.GatewayIPv6Address) | ||
} | ||
|
||
if gatewayIP != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding logging or error handling when gateway IP parsing fails so that missing or invalid gateway IPs can be diagnosed more easily.
if gatewayIP != nil { | |
if gatewayIP == nil { | |
fmt.Printf("Warning: Failed to parse gateway IP for PodIPInfo[%d]\n", i) | |
} else { |
Copilot uses AI. Check for mistakes.
@microsoft-github-policy-service agree company="Microsoft" |
Reason for Change:
This PR has changes specific to Prefix on NICv6
CNS
--Consuming PrimaryIPv6, GatewayIPv6, MacAddress (DeletedNIC) from NNC CRD because of dualstack NC
--IP allocation: Assign IPs of each IPFamily as part of RequestIPs api request
IPAM
--Change RequestIPs response parsing to read GatewayIPv6 and MacAddress
--Populates Interfaces with MacAddress which is used by CNI to plumb routes to send traffic
Requirements:
Notes: