Merge pull request #157 from crosbymichael/network-info
Only add network info if NEWNET is set
This commit is contained in:
commit
6de84a5afc
12
spec.go
12
spec.go
|
@ -191,11 +191,6 @@ func createLibcontainerConfig(spec *specs.LinuxSpec) (*configs.Config, error) {
|
|||
Readonlyfs: spec.Root.Readonly,
|
||||
Hostname: spec.Hostname,
|
||||
Privatefs: true,
|
||||
Networks: []*configs.Network{
|
||||
{
|
||||
Type: "loopback",
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, ns := range spec.Linux.Namespaces {
|
||||
t, exists := namespaceMapping[ns.Type]
|
||||
|
@ -204,6 +199,13 @@ func createLibcontainerConfig(spec *specs.LinuxSpec) (*configs.Config, error) {
|
|||
}
|
||||
config.Namespaces.Add(t, ns.Path)
|
||||
}
|
||||
if config.Namespaces.Contains(configs.NEWNET) {
|
||||
config.Networks = []*configs.Network{
|
||||
{
|
||||
Type: "loopback",
|
||||
},
|
||||
}
|
||||
}
|
||||
for _, m := range spec.Mounts {
|
||||
config.Mounts = append(config.Mounts, createLibcontainerMount(cwd, m))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue