Skip to content
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

Add Route info in output of "antctl get bgproutes" #6803

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Atish-iaf
Copy link
Contributor

For #6794

@Atish-iaf Atish-iaf marked this pull request as ready for review November 11, 2024 10:20
@Atish-iaf Atish-iaf linked an issue Nov 12, 2024 that may be closed by this pull request
@rajnkamr rajnkamr added this to the Antrea v2.3 release milestone Nov 12, 2024
@rajnkamr rajnkamr added the area/transit/bgp Issues or PRs related to BGP support. label Nov 12, 2024
docs/antctl.md Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
// routes stores all BGP routers advertised to BGP peers.
routes sets.Set[bgp.Route]
// routes stores all BGP routes advertised to BGP peers.
routes map[AdvertisedRouteType]sets.Set[bgp.Route]
Copy link
Contributor

Choose a reason for hiding this comment

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

The ability to provide a reference to the K8s object will require a different data structure here.
Personally, I would go with something like this:

type RouteMetadata struct {
        Type RouteType
        K8sObjRef string
}

routes map[bgp.Route]RouteMetadata
  1. you can easily get a set of desired routes with sets.KeySet(c.routes), requiring only minimal changes in reconcileBGPAdvertisements
  2. the handler will transform the data (as it already does) and filter routes if needed (based on type)

@Atish-iaf Atish-iaf force-pushed the add-route-type-for-antctl-get-bgproutes branch 2 times, most recently from f1854c3 to fbf32fe Compare November 18, 2024 10:20
@Atish-iaf Atish-iaf changed the title Add Route Type in output of "antctl get bgproutes" Add Route info in output of "antctl get bgproutes" Nov 18, 2024
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
pkg/agent/apiserver/handlers/bgproute/handler.go Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller_test.go Outdated Show resolved Hide resolved
docs/antctl.md Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
docs/antctl.md Outdated Show resolved Hide resolved
pkg/agent/apiserver/handlers/bgproute/handler.go Outdated Show resolved Hide resolved
pkg/agent/controller/bgp/controller.go Outdated Show resolved Hide resolved
@Atish-iaf Atish-iaf marked this pull request as draft November 20, 2024 09:12
@Atish-iaf Atish-iaf force-pushed the add-route-type-for-antctl-get-bgproutes branch from fbf32fe to 9b3af32 Compare November 21, 2024 05:25
@Atish-iaf Atish-iaf marked this pull request as ready for review November 21, 2024 06:30
@Atish-iaf Atish-iaf force-pushed the add-route-type-for-antctl-get-bgproutes branch 2 times, most recently from 5d7ebc9 to 0dba864 Compare November 21, 2024 15:58
@Atish-iaf Atish-iaf force-pushed the add-route-type-for-antctl-get-bgproutes branch from 0dba864 to bb7126a Compare November 21, 2024 16:13
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

@antoninbas
Copy link
Contributor

/test-all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transit/bgp Issues or PRs related to BGP support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add route type in output of "antctl get bgproutes"
4 participants