Add VRFRef to EVPNInstance and refactor L3VNI ownership#436
Open
felix-kaestner wants to merge 7 commits into
Open
Add VRFRef to EVPNInstance and refactor L3VNI ownership#436felix-kaestner wants to merge 7 commits into
felix-kaestner wants to merge 7 commits into
Conversation
The L3 VNI is better suited on the EVPNInstance resource where it is already present. Mark the VRF spec.vni field as deprecated and emit an admission warning when it is set, guiding users to migrate to the EVPNInstance VNI field instead. Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Add a vrfRef field to EVPNInstance for Routed type (L3VNI/IP-VRF), mirroring the existing vlanRef for Bridged type. The controller resolves the VRF, validates same-device ownership, and passes it to the provider. Refactor the NX-OS provider to split VRF YANG writes between two controllers: - EnsureVRF patches leaf fields (name, description) and replaces the domain items (RD, route targets) via Update. - EnsureEVPNInstance patches L3VNI/Encap on the VRF separately for Routed type instances. - DeleteEVPNInstance clears L3VNI/Encap when the VRF still exists. This avoids the two controllers overwriting each other's fields via gNMI Replace on the same YANG subtree. Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Add XValidation rule rejecting routeDistinguisher when type is Routed, since the RD for an IP-VRF is configured on the VRF resource itself. Update field documentation to clarify this constraint. Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Replace inline RD and RT formatting logic with the existing RouteDistinguisher() and RouteTarget() helpers from evi.go. Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Change BDEVI.Rd from plain string to Option[string] so it is only sent to the device when explicitly configured. Skip the RD call in EnsureEVPNInstance when RouteDistinguisher is empty. Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Add RouteDistinguisherAuto constant and accept "Auto" as a special value for the routeDistinguisher field on VRF and EVPNInstance. This maps to "rd auto" on the device CLI (NX-OS: rd:unknown:0:0). The extcommunity helper handles both empty and "Auto" as the auto- derivation case, keeping RouteDistinguisher/RouteTarget as simple wrappers. Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
289a20d to
632e5eb
Compare
Merging this branch changes the coverage (1 decrease, 2 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
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.
Move L3VNI configuration from the VRF resource to the EVPNInstance (Routed type). This aligns with how NX-OS models the relationship: the EVI owns the VNI-to-VRF binding, not the VRF itself.