Skip to content

Commit

Permalink
fix: delete chassis_private when delete node
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Mar 9, 2021
1 parent e5abdef commit 537588c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func (c Client) DeleteStaticRoute(cidr, router string) error {
}

func (c Client) DeleteStaticRouteByNextHop(nextHop string) error {
if nextHop == "" {
if strings.TrimSpace(nextHop) == "" {
return nil
}
output, err := c.ovnNbCommand("--format=csv", "--no-heading", "--data=bare", "--columns=ip_prefix", "find", "Logical_Router_Static_Route", fmt.Sprintf("nexthop=%s", nextHop))
Expand Down
2 changes: 1 addition & 1 deletion pkg/ovs/ovn-sbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c Client) DeleteChassis(node string) error {
for _, chassis := range strings.Split(output, "\n") {
chassis = strings.TrimSpace(chassis)
if len(chassis) > 0 {
if _, err := c.ovnSbCommand("chassis-del", strings.TrimSpace(chassis)); err != nil {
if _, err := c.ovnSbCommand("chassis-del", strings.TrimSpace(chassis), "--", "destroy", "chassis_private", strings.TrimSpace(chassis)); err != nil {
return err
}
}
Expand Down

0 comments on commit 537588c

Please sign in to comment.