Skip to content

Skip IP range duplicate check in validate_bgp_peer_group for different vnets#4179

Merged
StormLiangMS merged 9 commits intosonic-net:masterfrom
alawing:alawing/bgp_peer_range
Jan 15, 2026
Merged

Skip IP range duplicate check in validate_bgp_peer_group for different vnets#4179
StormLiangMS merged 9 commits intosonic-net:masterfrom
alawing:alawing/bgp_peer_range

Conversation

@alawing
Copy link
Contributor

@alawing alawing commented Jan 6, 2026

What I did

Skip IP range duplicate check in validate_bgp_peer_group for different vnets
Related issue: #2145

How I did it

Check duplicates only when both vnet_name and ip_range match

How to verify it

testbed tests and unit tests

Copilot AI review requested due to automatic review settings January 6, 2026 09:21
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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 PR modifies the BGP peer group validation logic to allow IP range reuse across different VRFs. Previously, duplicate IP ranges were rejected regardless of VRF context, but now the validation only flags duplicates when both the IP range and VRF match.

Key Changes

  • Modified validate_bgp_peer_group to track IP ranges per VRF using tuple keys (ip, vrf_name)
  • Added logic to default missing vrf_name to "default" VRF
  • Updated error messages to include VRF information when reporting duplicates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alawing alawing changed the title avoid ip_range check in validate_bgp_peer_group if vrf_name are different Skip IP range duplicate check in validate_bgp_peer_group for different VRFs Jan 6, 2026
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alawing alawing changed the title Skip IP range duplicate check in validate_bgp_peer_group for different VRFs Skip IP range duplicate check in validate_bgp_peer_group for different vnets Jan 7, 2026
@alawing alawing requested a review from Copilot January 7, 2026 00:16
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

lgtm @StormLiangMS , can you review and merge?

@alawing alawing force-pushed the alawing/bgp_peer_range branch from 89462b3 to ef8f334 Compare January 13, 2026 19:09
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

lgtm

@StormLiangMS StormLiangMS merged commit 137d594 into sonic-net:master Jan 15, 2026
8 checks passed
dhanasekar-arista pushed a commit to dhanasekar-arista/sonic-utilities that referenced this pull request Jan 21, 2026
…t vnets (sonic-net#4179)

What I did
Skip IP range duplicate check in validate_bgp_peer_group for different vnets
Related issue: sonic-net#2145

How I did it
Check duplicates only when both vnet_name and ip_range match

How to verify it
testbed tests and unit tests
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #4215

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-utilities.msft#281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants