Repository navigation
Add BGP redistribute static support - #662
Merged
Merged
Conversation
Merging this branch changes the coverage (2 decrease, 4 increase)
Coverage detailsCompared to commit a138cb3 (run #39623849807)
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:
|
felix-kaestner
previously approved these changes
Oct 27, 2026
Wire up `redistribute static route-map {RM}` under the BGP VRF
IPv4/IPv6 unicast address-families, mirroring the existing
redistribute direct path across both providers.
- API: add redistributeStaticRoutes to BGPUnicastAddressFamily
- NX-OS: emit a proto=static InterLeakP entry alongside direct
- OpenConfig: emit a STATIC table-connection and clean it up on delete
- Controller: resolve the static RoutingPolicy ref and re-reconcile
when it changes, via a shared resolver and route-policy index
Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
adamtrizuljak-sap
dismissed stale reviews from nikatza and felix-kaestner
via
October 28, 2026 09:36
cbea2f1
adamtrizuljak-sap
force-pushed
the
feat/bgp-redistribute-static
branch
from
October 28, 2026 09:36
049fe7c to
cbea2f1
Compare
adamtrizuljak-sap
enabled auto-merge (squash)
October 28, 2026 09:37
felix-kaestner
approved these changes
Oct 28, 2026
nikatza
approved these changes
Oct 28, 2026
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.
Summary
Adds support for
redistribute static route-map {RM}under the BGP VRF IPv4/IPv6 unicast address-families. This mirrors the existingredistribute directfeature end-to-end and is realized by both providers (Cisco NX-OS and OpenConfig), since the API field is provider-agnostic.Note: This PR added the feature to the existing Openconfig BGP provider, since the Nokia BGP provider is not yet implemented. This keeps feature parity with the NX-OS provider, but will have to be migrated.
Changes
api/core/v1alpha1/bgp_types.go): new optionalredistributeStaticRoutes.routingPolicyReffield onBGPUnicastAddressFamily(same shape asredistributeDirectRoutes). Regenerated CRD, deepcopy, and Helm chart.internal/provider/cisco/nxos): addedNewInterLeakPStatic(proto=static) and wired it into both AF blocks. The static entry coexists with direct as a distinctInterLeakP-listentry (keyed byproto), so noMarshalJSONchange was required.internal/provider/openconfig/bgp.go): addedPolicyTypeStatic, emit aSTATICtable-connection, and clean it up inDeleteBGP. The two redistribution loops were factored into a shared helper.internal/controller/core/bgp_controller.go): generalized the redistribute policy resolver to handle both direct and static refs, and broadened the field index so a RoutingPolicy change re-reconciles any BGP that references it for either kind.Behavior notes
gnmiextGet-and-Check diff only compares fields the provider writes). The device's platform defaults on the entry (scope=inter,srv6PrefixType=unspecified) do not cause false diffs.RoutingPolicymust exist and belong to the same device; otherwise the BGP reportsReady=FalsewithWaitingForDependenciesorCrossDeviceReference, consistent with the direct path.Testing
bgp_dom_af_rdst_static.json) covering direct+static coexistence on one AF.routingPolicyRefwaiting → ready transition.bgp_redistribute.txtar) for both providers, covering the expected device state and cleanup on delete.make vet lint test test-gnmiall pass (openconfig 23/23, nx.cisco 44/44).Tested against a simulated Cisco N9K-C9300v in Clabernetes using the provided
bgp-rdstBGP sample.Clean state:
After deploying the
bgp-rdstBGP sample without theredistributeStaticRoutesblock (for bothipv4Unicastandipv6Unicast):After deploying the
bgp-rdstBGP sample with theredistributeStaticRoutesblock (for bothipv4Unicastandipv6Unicast), the entries with"proto": "static"are added successfully