diff --git a/plugins/meta/sbr/main.go b/plugins/meta/sbr/main.go index 7a2892d2..1f575f9c 100644 --- a/plugins/meta/sbr/main.go +++ b/plugins/meta/sbr/main.go @@ -360,6 +360,13 @@ func tidyRules(iface string) error { link, err := netlink.LinkByName(iface) if err != nil { + // If interface is not found by any reason it's safe to ignore an error. Also, we don't need to raise an error + // during cmdDel call according to CNI spec: + // https://github.com/containernetworking/cni/blob/main/SPEC.md#del-remove-container-from-network-or-un-apply-modifications + _, notFound := err.(netlink.LinkNotFoundError) + if notFound { + return nil + } log.Printf("Failed to get link %s: %v", iface, err) return fmt.Errorf("Failed to get link %s: %v", iface, err) }