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 1a43c6d commit 86fab66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ovs/ovs-vsctl.go
Expand Up @@ -188,7 +188,7 @@ func ClearPodBandwidth(podName, podNamespace, ifaceID string) error {
// 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 @@ -206,7 +206,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 86fab66

Please sign in to comment.