mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
return routes for unknown next hops
This commit is contained in:
parent
93dc3763b0
commit
2e177ef9b2
@ -77,15 +77,9 @@ func (r *Routes) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
|
|||||||
|
|
||||||
var routes []*cloudprovider.Route
|
var routes []*cloudprovider.Route
|
||||||
for _, item := range router.Routes {
|
for _, item := range router.Routes {
|
||||||
nodeName, ok := nodeNamesByAddr[item.NextHop]
|
|
||||||
if !ok {
|
|
||||||
// Not one of our routes?
|
|
||||||
glog.V(4).Infof("Skipping route with unknown nexthop %v", item.NextHop)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
route := cloudprovider.Route{
|
route := cloudprovider.Route{
|
||||||
Name: item.DestinationCIDR,
|
Name: item.DestinationCIDR,
|
||||||
TargetNode: nodeName,
|
TargetNode: nodeNamesByAddr[item.NextHop], //empty if NextHop is unknown
|
||||||
DestinationCIDR: item.DestinationCIDR,
|
DestinationCIDR: item.DestinationCIDR,
|
||||||
}
|
}
|
||||||
routes = append(routes, &route)
|
routes = append(routes, &route)
|
||||||
|
Loading…
Reference in New Issue
Block a user