Skip to content

Conversation

@rejain789
Copy link
Contributor

@rejain789 rejain789 commented Nov 11, 2025

Reason for Change:

Backporting subnet overlay expansion to v1.5

Issue Fixed:

Requirements:

Notes:

@rejain789 rejain789 requested a review from a team as a code owner November 11, 2025 23:27
@rejain789 rejain789 changed the title [backport] v1.5 ci: [CNS] Overlay Expansion Subnet Update Job Bug Fix #4103 #4114 [backport] v1.5 ci: [CNS] Overlay Expansion Subnet Update Job Bug Fix #4103 Nov 11, 2025
Copilot finished reviewing on behalf of rejain789 November 11, 2025 23:35
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 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.

@rejain789
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rejain789
Copy link
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rejain789 rejain789 enabled auto-merge November 12, 2025 01:02
@rejain789 rejain789 added this pull request to the merge queue Nov 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 12, 2025
@rejain789 rejain789 added this pull request to the merge queue Nov 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 13, 2025
@rejain789 rejain789 added this pull request to the merge queue Nov 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 13, 2025
@rejain789 rejain789 added this pull request to the merge queue Nov 13, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 13, 2025
…4103 (#4115)

* backporting to 1.5

* added cidr check function

* backporting functions outside of overlay expansion

* reverted unneeded code changse
@thatmattlong thatmattlong removed this pull request from the merge queue due to the queue being cleared Nov 13, 2025
@thatmattlong thatmattlong added this pull request to the merge queue Nov 13, 2025
@thatmattlong thatmattlong removed this pull request from the merge queue due to the queue being cleared Nov 13, 2025
@thatmattlong thatmattlong merged commit a208275 into release/v1.5 Nov 13, 2025
14 checks passed
@thatmattlong thatmattlong deleted the jainriya/bp-4103-1.5 branch November 13, 2025 23:27
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.

3 participants