-
Notifications
You must be signed in to change notification settings - Fork 3
Redistribute static + IPv6 routes #2279
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1979,9 +1979,15 @@ def _add_vrf_configuration(config, vrf_info, netbox_interfaces): | |
| # Add ROUTE_REDISTRIBUTE for VRF | ||
| if "ROUTE_REDISTRIBUTE" not in config: | ||
| config["ROUTE_REDISTRIBUTE"] = {} | ||
| route_redistribute_key = f"{vrf_name}|connected|bgp|ipv4" | ||
| config["ROUTE_REDISTRIBUTE"][route_redistribute_key] = {} | ||
| logger.info(f"Added ROUTE_REDISTRIBUTE {route_redistribute_key}") | ||
| for proto, af in [ | ||
| ("connected", "ipv4"), | ||
| ("connected", "ipv6"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: IPv6 redistribution entries have no corresponding IPv6 unicast AF This loop emits |
||
| ("static", "ipv4"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please confirm: all static routes from every VNI-backed VRF redistributed into BGP with no filtering With the addition of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be best if we wait for #2173 which will introduce a way of installing default routes per VRF with Alternative would be a |
||
| ("static", "ipv6"), | ||
| ]: | ||
| key = f"{vrf_name}|{proto}|bgp|{af}" | ||
| config["ROUTE_REDISTRIBUTE"][key] = {} | ||
| logger.info(f"Added ROUTE_REDISTRIBUTE {key}") | ||
|
|
||
| elif "table_id" in vrf_data: | ||
| # VRF with table_id (no RD set in NetBox) | ||
|
|
||
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.
Missing test coverage for
ROUTE_REDISTRIBUTEThere are currently no tests for emitted
ROUTE_REDISTRIBUTEentries —_add_vrf_configuration()is only seen in the orchestrator test as a patch target, with no assertions on its output. This PR changes the emitted entry count from one to four, which is a behavioral change worth pinning. Please add a unit test (alongside the existing BGP globals tests in_config_generator_helpers.py) that calls_add_vrf_configuration()with a VNI-backed VRF fixture and asserts that all four expected keys are present in the resultingROUTE_REDISTRIBUTEtable.