Skip to content

Commit

Permalink
fix: gc node lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed May 25, 2020
1 parent a5e978b commit 84b6cdc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions pkg/controller/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ func (c *Controller) gcLogicalSwitchPort() error {
return err
}
for _, lsp := range lsps {
if !strings.Contains(lsp, ".") {
// ignore router ports
continue
}
if !util.IsStringIn(lsp, ipNames) {
klog.Infof("gc logical switch port %s", lsp)
if err := c.ovnClient.DeletePort(lsp); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (c Client) LogicalSwitchExists(logicalSwitch string) (bool, error) {
}

func (c Client) ListLogicalSwitchPort() ([]string, error) {
output, err := c.ovnNbCommand("--format=csv", "--data=bare", "--no-heading", "--columns=name", "list", "logical_switch_port")
output, err := c.ovnNbCommand("--format=csv", "--data=bare", "--no-heading", "--columns=name", "find", "logical_switch_port", "type!=router")
if err != nil {
klog.Errorf("failed to list logical switch port, %v", err)
return nil, err
Expand Down

0 comments on commit 84b6cdc

Please sign in to comment.