From 2ce475576781dc50ec5e2998982d19c80c305117 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 23 May 2022 17:45:09 -0400 Subject: Allow podman pod create --share +pid Fixes: https://github.com/containers/podman/issues/13422 Signed-off-by: Daniel J Walsh --- cmd/podman/pods/create.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd/podman') 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 -- cgit v1.2.3-54-g00ecf