aboutsummaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_infra_linux.go
diff options
context:
space:
mode:
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...)
}