summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/shared/create.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 94b1e63dc..a9cd3078b 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -376,6 +376,10 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
}
}
+ usernsType := c.String("userns")
+ if !c.IsSet("userns") && !idmappings.HostUIDMapping {
+ usernsType = "private"
+ }
// Kernel Namespaces
// TODO Fix handling of namespace from pod
// Instead of integrating here, should be done in libpod
@@ -386,7 +390,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
"pid": c.String("pid"),
"net": c.String("network"),
"ipc": c.String("ipc"),
- "user": c.String("userns"),
+ "user": usernsType,
"uts": c.String("uts"),
}