summaryrefslogtreecommitdiff
path: root/cmd/podman/pod_create.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-07-09 17:48:20 -0400
committerhaircommander <pehunt@redhat.com>2018-07-13 09:17:33 -0400
commita04a8d1dd4d375ebe5084bac760dc82f88cfc77f (patch)
tree4b02c7e49ec737c6e9ffd4412e5212b856df518c /cmd/podman/pod_create.go
parent1aad3fd96b61705243e8f6ae35f65946916aa8a5 (diff)
downloadpodman-a04a8d1dd4d375ebe5084bac760dc82f88cfc77f.tar.gz
podman-a04a8d1dd4d375ebe5084bac760dc82f88cfc77f.tar.bz2
podman-a04a8d1dd4d375ebe5084bac760dc82f88cfc77f.zip
Added full podman pod ps, with tests and man page
Signed-off-by: haircommander <pehunt@redhat.com>
Diffstat (limited to 'cmd/podman/pod_create.go')
-rw-r--r--cmd/podman/pod_create.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/cmd/podman/pod_create.go b/cmd/podman/pod_create.go
index 9bbc60d4d..f86faa409 100644
--- a/cmd/podman/pod_create.go
+++ b/cmd/podman/pod_create.go
@@ -17,13 +17,9 @@ var podCreateDescription = "Creates a new empty pod. The pod ID is then" +
" initial state 'created'."
var podCreateFlags = []cli.Flag{
- cli.BoolTFlag{
- Name: "cgroup-to-ctr",
- Usage: "Tells containers in this pod to use the cgroup created for the pod",
- },
cli.StringFlag{
Name: "cgroup-parent",
- Usage: "Optional parent cgroup for the pod",
+ Usage: "Set parent cgroup for the pod",
},
cli.StringSliceFlag{
Name: "label-file",
@@ -45,7 +41,7 @@ var podCreateFlags = []cli.Flag{
var podCreateCommand = cli.Command{
Name: "create",
- Usage: "create but do not start a pod",
+ Usage: "create a new empty pod",
Description: podCreateDescription,
Flags: podCreateFlags,
Action: podCreateCmd,
@@ -75,18 +71,11 @@ func podCreateCmd(c *cli.Context) error {
return errors.Wrapf(err, "unable to write pod id file %s", c.String("pod-id-file"))
}
}
- // BEGIN GetPodCreateOptions
- // TODO make sure this is correct usage
if c.IsSet("cgroup-parent") {
options = append(options, libpod.WithPodCgroupParent(c.String("cgroup-parent")))
}
- if c.Bool("cgroup-to-ctr") {
- options = append(options, libpod.WithPodCgroups())
- }
- // LABEL VARIABLES
- // TODO make sure this works as expected
labels, err := getAllLabels(c.StringSlice("label-file"), c.StringSlice("label"))
if err != nil {
return errors.Wrapf(err, "unable to process labels")
@@ -99,6 +88,9 @@ func podCreateCmd(c *cli.Context) error {
options = append(options, libpod.WithPodName(c.String("name")))
}
+ // always have containers use pod cgroups
+ options = append(options, libpod.WithPodCgroups())
+
pod, err := runtime.NewPod(options...)
if err != nil {
return err