-
Notifications
You must be signed in to change notification settings - Fork 3.4k
bgp: Refactor route policy reconciler #40319
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
Merged
Merged
Conversation
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
Currently, API => Agent route policy conversions such as ToAgentRoutePolicies are not used. Remove them for making maintenance easier. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
d7ff68b
to
0bf3bf4
Compare
/test |
Currently, the RoutePolicyConditions.MatchNeighbors option uses string to store the neighbor IP address. Using string makes the actual representation used for the IP address anbiguous. Use netip.Addr for type safety, efficiency, and clarity for readers. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
Fix peerAddressFromPolicy to return all peer addresses in the policy instead of returning only the first one. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
Currently, the ResetRoutePolicies only resets outbound. However, whenever we have an update for inbound policy, we should reset inbount. Fix it to handle both direction properly. This also fixes the bug where the old peers in the updated policies were not resetted. Add some test cases to ensure the resetting is called properly. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
0bf3bf4
to
df1d073
Compare
/test |
rastislavs
approved these changes
Jul 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects/v1.18
This issue affects v1.18 branch
area/bgp
Impacts the Border Gateway Protocol feature.
release-note/misc
This PR makes changes that have no direct user impact.
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.
This PR solves the following problems for BGP route policy reconciler.
netip.Addr
forMatchNeighbors
field in the policy condition. This is for efficiency and also fixes the issue that we breach the zone information for the IPv6 link-local address peers upon string conversion.peerAddressFromPolicy
only returns the first peer appears in the policy. This becomes a problem when we have multiple neighbors in the policy. Fix it to return multiple neighbors properly.