diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-25 08:57:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 08:57:15 -0400 |
commit | 800a367d737828193de5e41f8ad5587e2dde1f59 (patch) | |
tree | 3c0c8badf0ae88decba77d23b3085a26d41244aa /cmd/podman/pods/create.go | |
parent | 1dcd1c970d3438bd6044cce0aba9b7258cb6849d (diff) | |
parent | 2ce475576781dc50ec5e2998982d19c80c305117 (diff) | |
download | podman-800a367d737828193de5e41f8ad5587e2dde1f59.tar.gz podman-800a367d737828193de5e41f8ad5587e2dde1f59.tar.bz2 podman-800a367d737828193de5e41f8ad5587e2dde1f59.zip |
Merge pull request #14333 from rhatdan/pod
Allow podman pod create --share +pid
Diffstat (limited to 'cmd/podman/pods/create.go')
-rw-r--r-- | cmd/podman/pods/create.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index eaf6dd9d5..e2f80bdbc 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -166,7 +166,12 @@ func create(cmd *cobra.Command, args []string) error { if strings.Contains(share, "cgroup") && shareParent { return errors.Wrapf(define.ErrInvalidArg, "cannot define the pod as the cgroup parent at the same time as joining the infra container's cgroupNS") } - createOptions.Share = strings.Split(share, ",") + + if strings.HasPrefix(share, "+") { + createOptions.Share = append(createOptions.Share, strings.Split(specgen.DefaultKernelNamespaces, ",")...) + share = share[1:] + } + createOptions.Share = append(createOptions.Share, strings.Split(share, ",")...) createOptions.ShareParent = &shareParent if cmd.Flag("infra-command").Changed { // Only send content to server side if user changed defaults |