mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Jana Radhakrishnan](/assets/img/avatar_default.png)
Make sure to always explicitly set namespace for all kernel bound network operations irrespective of whether the operation is performed in init namespace or a user defined namespace. This already happens for user defined netns. But doesn't happen for initial netns that libnetwork runs in. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
10 lines
289 B
Go
10 lines
289 B
Go
package netutils
|
|
|
|
import "flag"
|
|
|
|
var runningInContainer = flag.Bool("incontainer", false, "Indicates if the test is running in a container")
|
|
|
|
// IsRunningInContainer returns whether the test is running inside a container.
|
|
func IsRunningInContainer() bool {
|
|
return (*runningInContainer)
|
|
}
|