summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_infra_linux.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-20 17:56:35 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 18:16:28 +0000
commit0e6266858a913ac36de0726ede10d5d03af533e3 (patch)
tree152c7b8b029d5eb80c6caf466c9d0ab1b0ef3913 /libpod/runtime_pod_infra_linux.go
parent2a7449362f2884d9ae6a783c0ce38979d882e2cf (diff)
downloadpodman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.gz
podman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.bz2
podman-0e6266858a913ac36de0726ede10d5d03af533e3.zip
Fixing network ns segfault
As well as small style corrections, update pod_top_test to use CreatePod, and move handling of adding a container to the pod's namespace from container_internal_linux to libpod/option. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1187 Approved by: mheon
Diffstat (limited to 'libpod/runtime_pod_infra_linux.go')
-rw-r--r--libpod/runtime_pod_infra_linux.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go
index 9649a3138..39bd8d07a 100644
--- a/libpod/runtime_pod_infra_linux.go
+++ b/libpod/runtime_pod_infra_linux.go
@@ -6,6 +6,8 @@ import (
"context"
"github.com/containers/libpod/libpod/image"
+ "github.com/containers/libpod/pkg/rootless"
+ "github.com/cri-o/ocicni/pkg/ocicni"
"github.com/opencontainers/runtime-tools/generate"
)
@@ -33,6 +35,11 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, imgID
options = append(options, WithName(containerName))
options = append(options, withIsInfra())
+ // Since user namespace sharing is not implemented, we only need to check if it's rootless
+ portMappings := make([]ocicni.PortMapping, 0)
+ networks := make([]string, 0)
+ options = append(options, WithNetNS(portMappings, rootless.IsRootless(), networks))
+
return r.newContainer(ctx, g.Config, options...)
}