Skip to content

bgp: Introduce bgp/routes Hive Shell command#44220

Merged
YutaroHayakawa merged 7 commits intomainfrom
yutaro/bgpv2-cli-routes
Feb 17, 2026
Merged

bgp: Introduce bgp/routes Hive Shell command#44220
YutaroHayakawa merged 7 commits intomainfrom
yutaro/bgpv2-cli-routes

Conversation

@YutaroHayakawa
Copy link
Copy Markdown
Member

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.

bgp: Introduce bgp/routes Hive Shell command

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>
@YutaroHayakawa YutaroHayakawa requested a review from a team as a code owner February 6, 2026 07:52
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 6, 2026
@YutaroHayakawa YutaroHayakawa marked this pull request as draft February 6, 2026 07:52
@YutaroHayakawa YutaroHayakawa added the release-note/misc This PR makes changes that have no direct user impact. label Feb 6, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 6, 2026
@YutaroHayakawa
Copy link
Copy Markdown
Member Author

/test

@YutaroHayakawa YutaroHayakawa marked this pull request as ready for review February 10, 2026 17:16
Copy link
Copy Markdown
Contributor

@rastislavs rastislavs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@YutaroHayakawa YutaroHayakawa added this pull request to the merge queue Feb 17, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 17, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 17, 2026
@YutaroHayakawa YutaroHayakawa added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit bcc36f9 Feb 17, 2026
503 of 505 checks passed
@YutaroHayakawa YutaroHayakawa deleted the yutaro/bgpv2-cli-routes branch February 17, 2026 15:56
@YutaroHayakawa YutaroHayakawa added the needs-backport/1.19 This PR / issue needs backporting to the v1.19 branch label Feb 19, 2026
@YutaroHayakawa YutaroHayakawa mentioned this pull request Feb 24, 2026
21 tasks
@YutaroHayakawa YutaroHayakawa added backport-pending/1.19 The backport for Cilium 1.19.x for this PR is in progress. and removed needs-backport/1.19 This PR / issue needs backporting to the v1.19 branch labels Feb 24, 2026
@github-actions github-actions bot added backport-done/1.19 The backport for Cilium 1.19.x for this PR is done. and removed backport-pending/1.19 The backport for Cilium 1.19.x for this PR is in progress. labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-done/1.19 The backport for Cilium 1.19.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants