Skip to content

Commit

Permalink
fix: gc logic router
Browse files Browse the repository at this point in the history
  • Loading branch information
fanriming committed Nov 4, 2020
1 parent 91fec56 commit 15eca9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (c *Controller) gcCustomLogicalRouter() error {
}
if !util.IsStringIn(lr, routerNames) {
klog.Infof("gc router %s", lr)
if err := c.handleDeleteSubnet(lr); err != nil {
if err := c.handleDeleteLogicRouter(lr); err != nil {
klog.Errorf("failed to gc router %s, %v", lr, err)
return err
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,10 @@ func (c *Controller) handleDeleteRoute(subnet *kubeovnv1.Subnet) error {
return c.ovnClient.DeleteStaticRoute(subnet.Spec.CIDRBlock, vpc.Router)
}

func (c *Controller) handleDeleteLogicRouter(key string) error {
return c.ovnClient.DeleteLogicalRouter(key)
}

func (c *Controller) handleDeleteSubnet(key string) error {
subnet, err := c.subnetsLister.Get(key)
if err != nil {
Expand Down

0 comments on commit 15eca9d

Please sign in to comment.