Skip to content

Commit

Permalink
fix: ovs gc just for pod if (#2187)
Browse files Browse the repository at this point in the history
  • Loading branch information
lut777 committed Dec 29, 2022
1 parent 799c824 commit c69685c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ovs/ovs-vsctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func SetInterfaceBandwidth(podName, podNamespace, iface, ingress, egress, podPri
// When reboot node, the ovs internal interface will be deleted.
func CleanLostInterface() {
// when interface error ofport will be -1
interfaceList, err := ovsFind("interface", "name,error", "ofport=-1")
interfaceList, err := ovsFind("interface", "name,error", "ofport=-1", "external_ids:pod_netns!=[]")
if err != nil {
klog.Errorf("failed to list failed interface %v", err)
return
Expand All @@ -265,7 +265,7 @@ func CleanLostInterface() {
return
}
klog.Infof("delete lost port %s", name)
output, err := Exec("--if-exists", "--with-iface", "del-port", "br-int", name)
output, err := Exec("--if-exists", "--with-iface", "del-port", name)
if err != nil {
klog.Errorf("failed to delete ovs port %v, %s", err, output)
return
Expand Down

0 comments on commit c69685c

Please sign in to comment.