Skip to content

Conversation

@kadevu
Copy link
Contributor

@kadevu kadevu commented Mar 21, 2025

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:

Copilot AI review requested due to automatic review settings March 21, 2025 18:04
@kadevu kadevu requested review from a team as code owners March 21, 2025 18:04
@kadevu kadevu requested a review from timraymond March 21, 2025 18:04
Copy link
Contributor

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 pull request adds IPv6 support to Azure Container Networking by enhancing metadata retrieval, updating network container contracts with IPFamily and gateway IPv6 fields, and modifying IPAM and REST server logic accordingly.

  • Update the IMDS client to retrieve and log network interface metadata including MAC addresses.
  • Enhance network container structures to include IPFamilies and gateway IPv6 addresses.
  • Revise IPAM, REST server, and delegated NIC assignment to accommodate IPv6 and improve logging.

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cns/imds/client.go Added network interface structs and a new method to get interface metadata; modified GetVMUniqueID to call this method.
cns/kubecontroller/nodenetworkconfig/conversion.go Introduced delegated NIC IP assignment and associated logging.
cns/NetworkContainerContract.go Added IPFamilies field and GatewayIPv6Address to contract structures.
cns/restserver/util.go Updated hostVersion assignment and added additional logging.
cns/kubecontroller/nodenetworkconfig/conversion_linux.go Propagated IPFamilies support in NC request creation.
cns/restserver/ipam.go Modified IP assignment logic to use IPFamily as key for available IPs.
azure-ipam/ipam.go Updated IPAM plugin to log and process interface and gateway info from the CNS response.
azure-ipam/ipconfig/ipconfig.go Modified response processing to return gateway IPs alongside pod IPs.
cns/restserver/internalapi_test.go Updated test generation to include IPFamilies.
cns/service/main.go Added logging around IMDS calls and refined CRD update logic.
cns/restserver/restserver.go Added an IPFamilies field to the HTTPRestService structure.
Files not reviewed (1)
  • go.mod: Language not supported
Comments suppressed due to low confidence (3)

cns/imds/client.go:124

  • The error from getInstanceInterfaceMacaddress is wrapped but not returned, which may lead to silent failures. Return the wrapped error or handle it appropriately.
if err != nil { errors.Wrap(err, "error getting IMDS interface metadata") }

cns/imds/client.go:205

  • [nitpick] Consider replacing fmt.Println with the consistent logging mechanism (e.g. logger.Printf) to ensure uniform error logging across the codebase.
fmt.Println("Error reading response:", err)

cns/kubecontroller/nodenetworkconfig/conversion.go:131

  • The error from nl.AddIPAddress is wrapped but not returned, which can cause silent failures during IP assignment. Return the wrapped error to handle the failure correctly.
if err != nil { errors.Wrapf(err, "failed to assign IP to delegated NIC") }

@tamilmani1989
Copy link
Member

@kadevu please update PR description and fix all pipeline failures

@kadevu kadevu force-pushed the ponv6support branch 8 times, most recently from 6cdc585 to 5b7d069 Compare April 10, 2025 05:39
@kadevu kadevu changed the title WIP: Ponv6support Prefix on NIC v6 support Apr 11, 2025

// Get Pod IP and gateway IP from ip config response
podIPNet, err := ipconfig.ProcessIPConfigsResp(resp)
podIPNet, gatewayIP, err := ipconfig.ProcessIPConfigsResp(resp)
Copy link
Member

Choose a reason for hiding this comment

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

what this gatewayIP is? why its required?

cniResult.Interfaces = []*types100.Interface{}
seenInterfaces := map[string]bool{}

for _, podIPInfo := range resp.PodIPInfo {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add a comment to clarify that we need to do dedup as there is one podipinfo for each of the ipfamily

@github-actions
Copy link

github-actions bot commented May 3, 2025

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added stale Stale due to inactivity. and removed stale Stale due to inactivity. labels May 3, 2025
@github-actions
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label May 20, 2025
@github-actions
Copy link

Pull request closed due to inactivity.

@github-actions github-actions bot closed this May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants