[202511_azd] [sonic-yang-models]: Add VNet name support to BGP_NEIGHBOR YANG model#2737
Open
miatttao wants to merge 3 commits into
Open
[202511_azd] [sonic-yang-models]: Add VNet name support to BGP_NEIGHBOR YANG model#2737miatttao wants to merge 3 commits into
miatttao wants to merge 3 commits into
Conversation
Signed-off-by: miatao <miatao@microsoft.com>
Signed-off-by: miatao <miatao@microsoft.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
The
BGP_NEIGHBORYANG model only accepted a VRF name (referencingBGP_GLOBALS) as the first key component. This prevented creating BGP neighbor configurations scoped to a VNet, such asBGP_NEIGHBOR|Vnet1|10.0.0.0, which is needed for overlay BGP sessions over VxLAN tunnels.Work item tracking
How I did it
Changed the
vrf_nameleaf type inBGP_NEIGHBOR_LISTandBGP_NEIGHBOR_AF_LISTfrom a plainleafrefto aunionof twoleafreftypes — one pointing toBGP_GLOBALS_LIST(existing VRF path) and one pointing toVNET_LIST(new VNet path). This follows the identical pattern already used insonic-bgp-peerrangefor the same requirement.Files changed:
yang-models/sonic-bgp-neighbor.yang— importsonic-vnet, changevrf_nameto unionleafref in both
BGP_NEIGHBOR_LISTandBGP_NEIGHBOR_AF_LISTdoc/Configuration.md— document VNet key format and add exampletests/files/sample_config_db.json— addVnet55|10.0.0.0BGP_NEIGHBOR andBGP_NEIGHBOR_AF entries
tests/yang_model_tests/tests/bgp.json— addBGP_NEIGHBOR_VNET_VALIDandBGP_NEIGHBOR_NEG_VNET_NOT_EXISTtest descriptorstests/yang_model_tests/tests_config/bgp.json— add full test data for both new casesHow to verify it
Run the existing YANG model tests:
Which release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO):
Failure type:
Tested branch
Test result
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)