bgp: Introduce bgp/routes Hive Shell command#44220
Merged
YutaroHayakawa merged 7 commits intomainfrom Feb 17, 2026
Merged
Conversation
We need this to query adj-rib in the new GetRoutes API. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
The current RouterManager.GetPeer API returns the API model directly. In the new CLI, we will rely on the new internal model. Since, we still need to keep the legacy output around for a while, mark it as legacy and keep it as is. We'll introduce a new implementation in the subsequent commits. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
- Remove unnecessary extra P from the function name - Fix the bug in the Instance and Peer deduplication logic - Don't sort slice including header Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
Introduce a new GetRoutes API on BGPRouterManager which returns BGPv2-native result. The result contains the Instance name that the route is retrieved from, and the Neighbor name for adj-rib-in and adj-rib-out. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
Introduce bgp/routes to query BGPRouterManager.GetRoutes and render a
structured table for loc-rib and adj-rib tables.
Example output:
loc-rib
```
Instance Prefix NextHop Best Age
instance0 10.0.0.0/32 0.0.0.0 true 10s
10.0.0.1/32 0.0.0.0 true 10s
instance1 10.0.0.2/32 0.0.0.0 true 10s
```
adj-rib
```
Instance Peer Prefix NextHop Age
instance0 peer0 10.244.0.0/24 10.99.0.110 10s
10.96.50.104/32 10.99.0.110 10s
peer1 10.244.0.0/24 10.99.0.110 10s
10.96.50.104/32 10.99.0.110 10s
instance1 peer2 10.244.0.0/24 10.99.0.110 10s
10.96.50.104/32 10.99.0.110 10s
```
It has an optional flags -o (output to file) and --no-age (disable Age
output to make the command output predictable).
Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
The adj-rib-in test requires the peer GoBGP to advertise the route. Add a simple command to advertise route from test GoBGP instance. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
Add a script test scenario that tests the output of the bgp/peers and bgp/routes commands. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
rastislavs
reviewed
Feb 6, 2026
Member
Author
|
/test |
21 tasks
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.
This is a preparation work to renew the current cilium-dbg bgp routes command output to reflect BGPv2 structure better. Introducing bgp/routes Hive Shell command which eventually become a backend of the cilium-dbg bgp routes command. Note that this PR doesn't replace cilium-dbg bpf routes. It will be covered in the separate PR. Please review commit-by-commit.