mirror of
https://github.com/containers/podman.git
synced 2025-11-30 01:58:46 +08:00
20 lines
384 B
Go
20 lines
384 B
Go
//go:build (linux || freebsd) && cni
|
|
|
|
package cni
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/vishvananda/netlink"
|
|
)
|
|
|
|
func deleteLink(name string) {
|
|
link, err := netlink.LinkByName(name)
|
|
if err == nil {
|
|
err = netlink.LinkDel(link)
|
|
// only log the error, it is not fatal
|
|
if err != nil {
|
|
logrus.Infof("Failed to remove network interface %s: %v", name, err)
|
|
}
|
|
}
|
|
}
|