Skip to content

Commit

Permalink
subnet: fix deleting lr policy on node deletion (#3176)
Browse files Browse the repository at this point in the history
Signed-off-by: 张祖建 <[email protected]>
  • Loading branch information
zhangzujian committed Sep 1, 2023
1 parent 0937303 commit 0505ca3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,7 @@ func (c *Controller) handleDeleteNode(key string) error {
return err
}

afs := []int{4, 6}
for _, af := range afs {
for _, af := range [...]int{4, 6} {
if err := c.deletePolicyRouteForLocalDnsCacheOnNode(key, af); err != nil {
return err
}
Expand Down Expand Up @@ -1126,8 +1125,8 @@ func (c *Controller) deletePolicyRouteForNode(nodeName string) error {
}
}
} else {
klog.Infof("delete policy route for centralized subnet %s", subnet.Name)
if err := c.deletePolicyRouteForCentralizedSubnet(subnet); err != nil {
klog.Infof("reconcile policy route for centralized subnet %s", subnet.Name)
if err := c.reconcileDefaultCentralizedSubnetRouteInDefaultVpc(subnet); err != nil {
klog.Errorf("failed to delete policy route for centralized subnet %s, %v", subnet.Name, err)
return err
}
Expand Down

0 comments on commit 0505ca3

Please sign in to comment.