diff options
author | haircommander <pehunt@redhat.com> | 2018-08-16 17:12:16 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-23 18:16:28 +0000 |
commit | 697b46430a8a7c2c7231078911dcec51f0c6fab5 (patch) | |
tree | 11c42e287c8b22d9a2e47788d1427dba118d9828 /cmd/podman/pod_create.go | |
parent | d5e690914dc78eca8664442e7677eb5004522bfd (diff) | |
download | podman-697b46430a8a7c2c7231078911dcec51f0c6fab5.tar.gz podman-697b46430a8a7c2c7231078911dcec51f0c6fab5.tar.bz2 podman-697b46430a8a7c2c7231078911dcec51f0c6fab5.zip |
Support pause containers in varlink
Signed-off-by: haircommander <pehunt@redhat.com>
Closes: #1187
Approved by: mheon
Diffstat (limited to 'cmd/podman/pod_create.go')
-rw-r--r-- | cmd/podman/pod_create.go | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/cmd/podman/pod_create.go b/cmd/podman/pod_create.go index 6975c9386..f5bb29c35 100644 --- a/cmd/podman/pod_create.go +++ b/cmd/podman/pod_create.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/containers/libpod/cmd/podman/libpodruntime" + "github.com/containers/libpod/cmd/podman/shared" "github.com/containers/libpod/libpod" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -116,29 +117,11 @@ func podCreateCmd(c *cli.Context) error { if c.BoolT("pause") { options = append(options, libpod.WithPauseContainer()) - for _, toShare := range strings.Split(c.String("share"), ",") { - switch toShare { - case "net": - options = append(options, libpod.WithPodNet()) - case "mnt": - //options = append(options, libpod.WithPodMNT()) - logrus.Debug("Mount Namespace sharing functionality not supported") - case "pid": - options = append(options, libpod.WithPodPID()) - case "user": - // Note: more set up needs to be done before this doesn't error out a create. - logrus.Debug("User Namespace sharing functionality not supported") - case "ipc": - options = append(options, libpod.WithPodIPC()) - case "uts": - options = append(options, libpod.WithPodUTS()) - case "": - case "none": - continue - default: - return errors.Errorf("Invalid kernel namespace to share: %s. Options are: %s, or none", toShare, strings.Join(libpod.KernelNamespaces, ",")) - } + nsOptions, err := shared.GetNamespaceOptions(strings.Split(c.String("share"), ",")) + if err != nil { + return err } + options = append(options, nsOptions...) } // always have containers use pod cgroups |