Add default route only when skipdefaultroutes flag to false in dualni…#4043
Add default route only when skipdefaultroutes flag to false in dualni…#4043paulyufan2 wants to merge 10 commits intomasterfrom
Conversation
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: tamilmani1989 <tamanoha@microsoft.com> Signed-off-by: Paul Yu <129891899+paulyufan2@users.noreply.github.com>
Co-authored-by: tamilmani1989 <tamanoha@microsoft.com> Signed-off-by: Paul Yu <129891899+paulyufan2@users.noreply.github.com>
There was a problem hiding this comment.
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
SkipDefaultRoutesflag 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.
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
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 |
|
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 |
|
Pull request closed due to inactivity. |
…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: