Skip to content

Commit

Permalink
Merge pull request #104 from MikeZappa87/issue/removeloopbackup
Browse files Browse the repository at this point in the history
Remove code that sets lo to down prior ns deletion
  • Loading branch information
openshift-merge-robot authored May 4, 2022
2 parents 5a8ca50 + e4812d9 commit 2eb3d07
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
5 changes: 0 additions & 5 deletions pkg/ocicni/ocicni.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,6 @@ func (plugin *cniNetworkPlugin) TearDownPodWithContext(ctx context.Context, podN
plugin.podLock(podNetwork).Lock()
defer plugin.podUnlock(podNetwork)

if err := tearDownLoopback(podNetwork.NetNS); err != nil {
// ignore error
logrus.Warningf("Ignoring error tearing down loopback interface: %v", err)
}

return plugin.forEachNetwork(&podNetwork, true, func(network *cniNetwork, podNetwork *PodNetwork, rt *libcni.RuntimeConf) error {
fullPodName := buildFullPodName(*podNetwork)
logrus.Infof("Deleting pod %s from CNI network %q (type=%v)", fullPodName, network.name, network.config.Plugins[0].Network.Type)
Expand Down
14 changes: 0 additions & 14 deletions pkg/ocicni/util_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,6 @@ func getContainerDetails(nsm *nsManager, netnsPath, interfaceName, addrType stri
return ipNet, &mac, nil
}

func tearDownLoopback(netns string) error {
return ns.WithNetNSPath(netns, func(_ ns.NetNS) error {
link, err := netlink.LinkByName(loIfname)
if err != nil {
return err // not tested
}
err = netlink.LinkSetDown(link)
if err != nil {
return err // not tested
}
return nil
})
}

func bringUpLoopback(netns string) error {
if err := ns.WithNetNSPath(netns, func(_ ns.NetNS) error {
link, err := netlink.LinkByName(loIfname)
Expand Down

0 comments on commit 2eb3d07

Please sign in to comment.