diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-05-23 17:45:09 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-05-24 15:58:31 -0400 |
commit | 2ce475576781dc50ec5e2998982d19c80c305117 (patch) | |
tree | 9b7118c98b02e508cdd55c41f3b53931d826ec59 /cmd/podman | |
parent | 0f5c06dac58645943469c63999931c165dba9031 (diff) | |
download | podman-2ce475576781dc50ec5e2998982d19c80c305117.tar.gz podman-2ce475576781dc50ec5e2998982d19c80c305117.tar.bz2 podman-2ce475576781dc50ec5e2998982d19c80c305117.zip |
Allow podman pod create --share +pid
Fixes: https://github.com/containers/podman/issues/13422
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-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 62f820790..162379659 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -159,7 +159,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 |