Skip to content

Commit 7ca2e4b

Browse files
VPC controller: add externalids with static routes across various locations
Signed-off-by: isabelleatkins <[email protected]>
1 parent da7e6e9 commit 7ca2e4b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/controller/vpc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,15 @@ func (c *Controller) handleAddOrUpdateVpc(key string) error {
480480
if item.BfdID != "" {
481481
klog.Infof("vpc %s add static ecmp route: %+v", vpc.Name, item)
482482
if err = c.OVNNbClient.AddLogicalRouterStaticRoute(
483-
vpc.Name, item.RouteTable, convertPolicy(item.Policy), item.CIDR, &item.BfdID, nil, item.NextHopIP,
483+
vpc.Name, item.RouteTable, convertPolicy(item.Policy), item.CIDR, &item.BfdID, externalIDs, item.NextHopIP,
484484
); err != nil {
485485
klog.Errorf("failed to add bfd static route to vpc %s , %v", vpc.Name, err)
486486
return err
487487
}
488488
} else {
489489
klog.Infof("vpc %s add static route: %+v", vpc.Name, item)
490490
if err = c.OVNNbClient.AddLogicalRouterStaticRoute(
491-
vpc.Name, item.RouteTable, convertPolicy(item.Policy), item.CIDR, nil, nil, item.NextHopIP,
491+
vpc.Name, item.RouteTable, convertPolicy(item.Policy), item.CIDR, nil, externalIDs, item.NextHopIP,
492492
); err != nil {
493493
klog.Errorf("failed to add normal static route to vpc %s , %v", vpc.Name, err)
494494
return err
@@ -961,7 +961,7 @@ func (c *Controller) addStaticRouteToVpc(name string, route *kubeovnv1.StaticRou
961961
} else {
962962
klog.Infof("vpc %s add static route: %+v", name, route)
963963
if err := c.OVNNbClient.AddLogicalRouterStaticRoute(
964-
name, route.RouteTable, convertPolicy(route.Policy), route.CIDR, nil, nil, route.NextHopIP,
964+
name, route.RouteTable, convertPolicy(route.Policy), route.CIDR, nil, externalIDs, route.NextHopIP,
965965
); err != nil {
966966
klog.Errorf("failed to add normal static route to vpc %s , %v", name, err)
967967
return err

pkg/controller/vpc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func Test_handleAddOrUpdateVpc_staticRoutes(t *testing.T) {
106106
"dst-ip",
107107
"192.168.0.0/24",
108108
nil,
109-
nil,
109+
externalIDs,
110110
"10.0.0.1",
111111
).Return(nil)
112112
mockOvnClient.EXPECT().ClearLogicalRouterPolicy(vpcName).Return(nil)
@@ -283,7 +283,7 @@ func Test_handleAddOrUpdateVpc_staticRoutes(t *testing.T) {
283283
"dst-ip",
284284
"192.168.0.0/24",
285285
nil,
286-
nil,
286+
externalIDs,
287287
"10.0.0.1",
288288
).Return(nil)
289289
mockOvnClient.EXPECT().ClearLogicalRouterPolicy(vpcName).Return(nil)

0 commit comments

Comments
 (0)