Skip to content

Commit 9f0eca2

Browse files
Merge pull request #1777 from nalind/no-config-for-extant-netns
Only configure networking when creating a net ns
2 parents 59c60d1 + 4521d4b commit 9f0eca2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcontainer/specconv/spec_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
216216
}
217217
config.Namespaces.Add(t, ns.Path)
218218
}
219-
if config.Namespaces.Contains(configs.NEWNET) {
219+
if config.Namespaces.Contains(configs.NEWNET) && config.Namespaces.PathOf(configs.NEWNET) == "" {
220220
config.Networks = []*configs.Network{
221221
{
222222
Type: "loopback",

0 commit comments

Comments
 (0)