From 1aad3fd96b61705243e8f6ae35f65946916aa8a5 Mon Sep 17 00:00:00 2001 From: haircommander Date: Mon, 9 Jul 2018 13:04:29 -0400 Subject: Podman pod create/rm commands with man page and tests. Includes a very stripped down version of podman pod ps, just for testing Signed-off-by: haircommander --- pkg/spec/createconfig.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg') diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index 7dfb9588c..dbbf99325 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -318,6 +318,14 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime) ([]lib logrus.Debugf("appending name %s", c.Name) options = append(options, libpod.WithName(c.Name)) } + if c.Pod != "" { + logrus.Debugf("appending to pod %s", c.Pod) + pod, err := runtime.LookupPod(c.Pod) + if err != nil { + return nil, errors.Wrapf(err, "unable to add container to pod") + } + options = append(options, runtime.WithPod(pod)) + } if len(c.PortBindings) > 0 { portBindings, err = c.CreatePortBindings() -- cgit v1.2.3-54-g00ecf