-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[yang models] Add vnet/vrf to bgp peer range #24531
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
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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 PR adds support for associating BGP peer ranges with VRF/VNET contexts in the YANG model. Previously, the BGP peer range model did not include fields to specify which VRF or VNET a peer range belongs to, even though this functionality was supported in the underlying system.
Key changes:
- Added
vrf_namefield to BGP peer range configuration with support for both VRF and VNET references - Introduced composite key structure (
vrf_name,peer_range_name) for the newBGP_PEER_RANGE_LIST - Maintained backward compatibility through separate
BGP_PEER_RANGE_TEMPLATE_LISTwithout VRF/VNET association - Added comprehensive test coverage for valid VRF, valid VNET, and invalid VRF/VNET cases
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/sonic-yang-models/yang-models/sonic-bgp-peerrange.yang |
Added imports for sonic-vrf and sonic-vnet modules; introduced BGP_PEER_RANGE_LIST with vrf_name support while preserving BGP_PEER_RANGE_TEMPLATE_LIST for backward compatibility |
src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json |
Updated test configurations to use template list for basic case; added test cases for valid VRF, valid VNET, and invalid VRF/VNET scenarios |
src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json |
Added test case definitions with descriptions and expected validation results |
src/sonic-yang-models/tests/files/sample_config_db.json |
Added sample configurations demonstrating BGP peer ranges with VRF and VNET associations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
StormLiangMS
left a comment
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.
LGTM
|
@vaibhavhd could you take a look? |
|
I don't have any concerns with this change. However, @Leyza could you describe how this gap was detected? Is there a testcase to detect the gap here? Was there a config application failure due to the lack of this change on YANG model. Also trying to understand why this was missed to begin with. How did we not catch this gap when the feature that added support for "Bgp peer range to associate with a vnet or vrf" was added? |
|
@vaibhavhd We have a use case where we configure vnet bgp peer ranges, and that's where we noticed that the configuration did not pass yang validations, but functionality-wise everything is working. There will be test cases in the future that we are working on that will be applying vnet bgp peer ranges so this case will be covered there. |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported. Work item tracking Microsoft ADO (number only): 31626685 How I did it Added vnet/vrf name field to the key for bgp peer range. How to verify it Tested on a physical testbed and UTs Signed-off-by: gordon-nexthop <[email protected]>
Why I did it Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported. Work item tracking Microsoft ADO (number only): 31626685 How I did it Added vnet/vrf name field to the key for bgp peer range. How to verify it Tested on a physical testbed and UTs
Why I did it Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported. Work item tracking Microsoft ADO (number only): 31626685 How I did it Added vnet/vrf name field to the key for bgp peer range. How to verify it Tested on a physical testbed and UTs
Why I did it Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported. Work item tracking Microsoft ADO (number only): 31626685 How I did it Added vnet/vrf name field to the key for bgp peer range. How to verify it Tested on a physical testbed and UTs Signed-off-by: Navdha Jindal <[email protected]>
|
Cherry-pick PR to 202511: #24720 |
Why I did it Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported. Work item tracking Microsoft ADO (number only): 31626685 How I did it Added vnet/vrf name field to the key for bgp peer range. How to verify it Tested on a physical testbed and UTs Signed-off-by: venu-nexthop <[email protected]>
Why I did it Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported. Work item tracking Microsoft ADO (number only): 31626685 How I did it Added vnet/vrf name field to the key for bgp peer range. How to verify it Tested on a physical testbed and UTs Signed-off-by: Feng Pan <[email protected]>
|
Cherry-pick PR to msft-202506: Azure/sonic-buildimage-msft#1875 |
Why I did it
Bgp peer range yang model currently has no field to associate with a vnet or vrf, even though this feature is supported.
Work item tracking
How I did it
Added vnet/vrf name field to the key for bgp peer range.
How to verify it
Tested on a physical testbed and UTs

Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)