File: config_linux.go

package info (click to toggle)
golang-github-containers-common 0.62.2%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,436 kB
  • sloc: makefile: 131; sh: 102
file content (19 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//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)
		}
	}
}