-
Notifications
You must be signed in to change notification settings - Fork 260
[backport] v1.5 ci: [CNS] Overlay Expansion Subnet Update Job Bug Fix #4103 #4115
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
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 backport PR introduces subnet expansion validation logic for overlay networks in CNS (Container Network Service), specifically addressing bug fixes related to CIDR superset validation during Network Container updates. The changes allow NC primary IP updates when the new subnet is a superset of the existing subnet (e.g., expanding from /24 to /20), while still rejecting incompatible subnet changes.
Key changes:
- Added CIDR superset validation logic before rejecting primary IP changes in
CreateOrUpdateNetworkContainerInternal - Added comprehensive test coverage for both valid subnet expansions and invalid subnet changes
- Refactored existing test to use table-driven approach with multiple test cases
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| cns/restserver/internalapi.go | Adds subnet expansion validation by calling validateCIDRSuperset to check if new CIDR is a superset of existing CIDR before returning PrimaryCANotSame error |
| cns/restserver/internalapi_test.go | Refactors TestReconcileNCStatePrimaryIPChangeShouldFail to table-driven tests and adds new TestReconcileNCStatePrimaryIPChangeShouldNotFail test to validate subnet expansion scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/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). |
Reason for Change:
Backporting subnet overlay expansion to v1.5
Issue Fixed:
Requirements:
Notes: