- The "linux" build tags were redundant as they were in a _linux file
- The project already states that go1.10 is a minimum (and long obsolete,
so unlikely to be used still).
- Format the remaining build-tags for current go versions.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The syscall package is deprecated and no longer updated as per
https://golang.org/pkg/syscall/. Use the golang.org/x/sys/unix package
instead, which also provides a wrapper for SYS_SETNS, so the syscall
number encoding depending on runtime.GOARCH can be dropped.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This prevents netns from being used on older Go runtimes on which it's
not safe to perform any state manipulations of a scheduling thread
(https://github.com/golang/go/issues/20676).
Signed-off-by: Martynas Pumputis <m@lambda.lt>
When using Kubernetes with CNI and Docker, the cgroup entries are
dropped in yet another creative place. This adds yet another attempt
to locate the container within `kubepods`. All of this because there
are no named network namespaces created.
With ubuntu 16.04 and docker-engine 1.11, the docker netns detection
function failed to look for the correct location of task file. This
change fixed the issue.
Signed-off-by: Zhenfang Wei <kopkop@gmail.com>
This commit adds build flags for the various architectures to prevent
failures when cross compiling. It also fixes errors in
netns_unspecified.go by replacing the undefined type Namespace with
NsHandle
Signed-off-by: Dave Tucker <dt@docker.com>
GetFromPid gets the namespace of the main thread, so previously Get
returned the wrong value if run from any other thread. Add a new
GetFromThread which uses the Linux thread id and switch Get to it.