-
Notifications
You must be signed in to change notification settings - Fork 368
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 Type in output of "antctl get bgproutes" #6803
base: main
Are you sure you want to change the base?
Add Route Type in output of "antctl get bgproutes" #6803
Conversation
Signed-off-by: Kumar Atish <[email protected]>
192.168.77.100/32 | ||
fec0::10:96:10:10/128 | ||
fec0::192:168:77:100/128 | ||
ROUTE TYPE |
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.
This would be more valuable IMO if in addition to the type, we had a reference to the K8s object
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.
Agree , as there might be multiple resources for a crd, In future, for ex, we could support multiple egress ips,
Something like below will be more explanatory and respectively for other resources
ROUTE TYPE K8s OBJECT REFERENCE
172.18.0.3/32 EgressIP Egress: egress-1
LoadBalancerIP AdvertisedRouteType = "LoadBalancerIP" | ||
ExternalIP AdvertisedRouteType = "ExternalIP" | ||
ClusterIP AdvertisedRouteType = "ClusterIP" |
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.
nit: I would add a Service
prefix to these
// 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] |
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.
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
- you can easily get a set of desired routes with
sets.KeySet(c.routes)
, requiring only minimal changes inreconcileBGPAdvertisements
- the handler will transform the data (as it already does) and filter routes if needed (based on type)
For #6794