From f7321681d04d65da3b307d1e5e4ba12c42b5c456 Mon Sep 17 00:00:00 2001 From: cdoern Date: Wed, 7 Jul 2021 17:00:30 -0400 Subject: podman pod create --pid flag added support for --pid flag. User can specify ns:file, pod, private, or host. container returns an error since you cannot point the ns of the pods infra container to a container outside of the pod. Signed-off-by: cdoern --- cmd/podman/pods/create.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd/podman/pods') diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index 03e3ffaa0..0d299bb9c 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -102,6 +102,10 @@ func init() { flags.StringVarP(&createOptions.Hostname, hostnameFlagName, "", "", "Set a hostname to the pod") _ = createCommand.RegisterFlagCompletionFunc(hostnameFlagName, completion.AutocompleteNone) + pidFlagName := "pid" + flags.StringVar(&createOptions.Pid, pidFlagName, "", "PID namespace to use") + _ = createCommand.RegisterFlagCompletionFunc(pidFlagName, common.AutocompleteNamespace) + podIDFileFlagName := "pod-id-file" flags.StringVar(&podIDFile, podIDFileFlagName, "", "Write the pod ID to the file") _ = createCommand.RegisterFlagCompletionFunc(podIDFileFlagName, completion.AutocompleteDefault) @@ -179,6 +183,8 @@ func create(cmd *cobra.Command, args []string) error { defer errorhandling.SyncQuiet(podIDFD) } + createOptions.Pid = cmd.Flag("pid").Value.String() + createOptions.Net, err = common.NetFlagsToNetOptions(cmd, createOptions.Infra) if err != nil { return err -- cgit v1.2.3-54-g00ecf