Skip to content

Commit

Permalink
Merge pull request #356 from alauda/fix/gc-node
Browse files Browse the repository at this point in the history
fix: gc node lsp
  • Loading branch information
oilbeater authored May 25, 2020
2 parents a5e978b + 84b6cdc commit e967b4c
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 e967b4c

Please sign in to comment.