summaryrefslogtreecommitdiff
path: root/cmd/podman/create.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 /cmd/podman/create.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 'cmd/podman/create.go')
-rw-r--r--cmd/podman/create.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index d6bcea7bd..3429c4d97 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -389,7 +389,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
pidModeStr := c.String("pid")
if !c.IsSet("pid") && pod != nil && pod.SharesPID() {
- pidModeStr = "pod"
+ pidModeStr = cc.POD
}
pidMode := container.PidMode(pidModeStr)
if !cc.Valid(string(pidMode), pidMode) {
@@ -398,7 +398,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
usernsModeStr := c.String("userns")
if !c.IsSet("userns") && pod != nil && pod.SharesUser() {
- usernsModeStr = "pod"
+ usernsModeStr = cc.POD
}
usernsMode := container.UsernsMode(usernsModeStr)
if !cc.Valid(string(usernsMode), usernsMode) {
@@ -407,7 +407,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
utsModeStr := c.String("uts")
if !c.IsSet("uts") && pod != nil && pod.SharesUTS() {
- utsModeStr = "pod"
+ utsModeStr = cc.POD
}
utsMode := container.UTSMode(utsModeStr)
if !cc.Valid(string(utsMode), utsMode) {
@@ -416,15 +416,15 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
ipcModeStr := c.String("ipc")
if !c.IsSet("ipc") && pod != nil && pod.SharesIPC() {
- ipcModeStr = "pod"
+ ipcModeStr = cc.POD
}
ipcMode := container.IpcMode(ipcModeStr)
if !cc.Valid(string(ipcMode), ipcMode) {
return nil, errors.Errorf("--ipc %q is not valid", ipcMode)
}
- netModeStr := c.String("net")
- if !c.IsSet("net") && pod != nil && pod.SharesNet() {
- netModeStr = "pod"
+ netModeStr := c.String("network")
+ if !c.IsSet("network") && pod != nil && pod.SharesNet() {
+ netModeStr = cc.POD
}
// Make sure if network is set to container namespace, port binding is not also being asked for
netMode := container.NetworkMode(netModeStr)