ns: add interface, use it, and fix thread-related namespace switch issues
authorDan Williams <dcbw@redhat.com>
Tue, 5 Apr 2016 16:10:31 +0000 (11:10 -0500)
committerDan Williams <dcbw@redhat.com>
Fri, 20 May 2016 22:10:25 +0000 (17:10 -0500)
commitf2922c5c1fa8f9378df55f281ba1fa664d8ea53d
treecffae381e2fe80a4a287e2daeeb63df3239b6ab5
parentc019ed25d2dca7eaa9aa0e4f07db05eac613cbee
ns: add interface, use it, and fix thread-related namespace switch issues

Add a namespace object interface for somewhat cleaner code when
creating and switching between network namespaces.  All created
namespaces are now mounted in /var/run/netns to ensure they
have persistent inodes and paths that can be passed around
between plugin components without relying on the current namespace
being correct.

Also remove the thread-locking arguments from the ns package
per https://github.com/appc/cni/issues/183 by doing all the namespace
changes in a separate goroutine that locks/unlocks itself, instead of
the caller having to track OS thread locking.
ip/link.go
ns/README.md [new file with mode: 0644]
ns/consts_linux_386.go [deleted file]
ns/consts_linux_amd64.go [deleted file]
ns/consts_linux_arm.go [deleted file]
ns/ns.go
ns/ns_test.go
testhelpers/testhelpers.go [deleted file]
testhelpers/testhelpers_suite_test.go [deleted file]
testhelpers/testhelpers_test.go [deleted file]