Skip to content

Conversation

paulyufan2
Copy link
Contributor

…c scenario

Reason for Change:

This PR is to add the default route only when skipdefaultroutes flag set to false in dualnic scenario

Issue Fixed:

Requirements:

Notes:

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

paulyufan2 and others added 2 commits October 2, 2025 11:12
Co-authored-by: tamilmani1989 <[email protected]>
Signed-off-by: Paul Yu <[email protected]>
Co-authored-by: tamilmani1989 <[email protected]>
Signed-off-by: Paul Yu <[email protected]>
@paulyufan2 paulyufan2 marked this pull request as ready for review October 2, 2025 15:13
@paulyufan2 paulyufan2 requested a review from a team as a code owner October 2, 2025 15:13
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 15:13
Copy link
Contributor

@Copilot 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 conditional logic to prevent default routes from being added when the SkipDefaultRoutes flag is set to true in dual NIC scenarios. This prevents duplicate default routes from being given to the Host Network Service (HNS).

Key changes:

  • Extracted default route creation logic into a reusable function
  • Added conditional check for SkipDefaultRoutes flag before adding default routes
  • Enhanced test coverage with a new test case for the skip scenario

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
cni/network/multitenancy.go Refactored default route logic into addDefaultRoute method and added conditional check for SkipDefaultRoutes flag
cni/network/multitenancy_test.go Updated existing test case name and added new test case to verify behavior when SkipDefaultRoutes=true

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@paulyufan2
Copy link
Contributor Author

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants