Skip to content

Commit

Permalink
Merge pull request #15 from squeed/lo-no-teardown
Browse files Browse the repository at this point in the history
Bug 1754638: loopback: don't tear down
  • Loading branch information
stevekuznetsov committed Sep 23, 2019
2 parents 446a8c7 + bb4969b commit b5e1059
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
21 changes: 0 additions & 21 deletions plugins/main/loopback/loopback.go
Expand Up @@ -49,27 +49,6 @@ func cmdAdd(args *skel.CmdArgs) error {
}

func cmdDel(args *skel.CmdArgs) error {
if args.Netns == "" {
return nil
}
args.IfName = "lo" // ignore config, this only works for loopback
err := ns.WithNetNSPath(args.Netns, func(ns.NetNS) error {
link, err := netlink.LinkByName(args.IfName)
if err != nil {
return err // not tested
}

err = netlink.LinkSetDown(link)
if err != nil {
return err // not tested
}

return nil
})
if err != nil {
return err // not tested
}

return nil
}

Expand Down
1 change: 1 addition & 0 deletions plugins/main/loopback/loopback_test.go
Expand Up @@ -82,6 +82,7 @@ var _ = Describe("Loopback", func() {
It("sets the lo device to DOWN", func() {

Skip("TODO: add network name")
Skip("We don't want to tear loopback down")
command.Env = append(environ, fmt.Sprintf("CNI_COMMAND=%s", "DEL"))

session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter)
Expand Down

0 comments on commit b5e1059

Please sign in to comment.