diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-23 19:32:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 19:32:08 +0200 |
commit | 802763c6042e1c9a812f4300c3c717630564c8bc (patch) | |
tree | 9118ada4b03b965f98141d773469660b7a227ed9 /cmd/podman/common/create.go | |
parent | e5a3e46746a0db9fcd9b701693d557438420d1e4 (diff) | |
parent | 48530acbd9a622cf88dbbb10cbc8e91575c476e5 (diff) | |
download | podman-802763c6042e1c9a812f4300c3c717630564c8bc.tar.gz podman-802763c6042e1c9a812f4300c3c717630564c8bc.tar.bz2 podman-802763c6042e1c9a812f4300c3c717630564c8bc.zip |
Merge pull request #5933 from giuseppe/fix-namespaces
podman, v2: handle namespaces specified on the CLI
Diffstat (limited to 'cmd/podman/common/create.go')
-rw-r--r-- | cmd/podman/common/create.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index bdf762ed7..a0aed984c 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -49,8 +49,9 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "cap-drop", []string{}, "Drop capabilities from the container", ) + cgroupNS := "" createFlags.StringVar( - &cf.CGroupsNS, + &cgroupNS, "cgroupns", containerConfig.CgroupNS(), "cgroup namespace to use", ) @@ -247,8 +248,9 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "interactive", "i", false, "Keep STDIN open even if not attached", ) + ipcNS := "" createFlags.StringVar( - &cf.IPC, + &ipcNS, "ipc", containerConfig.IPCNS(), "IPC namespace to use", ) @@ -329,8 +331,9 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "use `OS` instead of the running OS for choosing images", ) // markFlagHidden(createFlags, "override-os") + pid := "" createFlags.StringVar( - &cf.PID, + &pid, "pid", containerConfig.PidNS(), "PID namespace to use", ) @@ -394,8 +397,9 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "security-opt", containerConfig.SecurityOptions(), "Security Options", ) + shmSize := "" createFlags.StringVar( - &cf.ShmSize, + &shmSize, "shm-size", containerConfig.ShmSize(), "Size of /dev/shm "+sizeWithUnitFormat, ) @@ -460,13 +464,15 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])", ) + userNS := "" createFlags.StringVar( - &cf.UserNS, + &userNS, "userns", containerConfig.Containers.UserNS, "User namespace to use", ) + utsNS := "" createFlags.StringVar( - &cf.UTS, + &utsNS, "uts", containerConfig.Containers.UTSNS, "UTS namespace to use", ) |