diff --git a/cmd/kpod/ps.go b/cmd/kpod/ps.go index b8bc7f0e..e66573df 100644 --- a/cmd/kpod/ps.go +++ b/cmd/kpod/ps.go @@ -89,8 +89,6 @@ type namespace struct { UTS string `json:"uts,omitempty"` } -const runningState = "running" - var ( psFlags = []cli.Flag{ cli.BoolFlag{ @@ -271,7 +269,7 @@ func getContainers(containers []*libkpod.ContainerData, opts psOptions) []*libkp return containers } for _, ctr := range containers { - if ctr.State.Status == runningState { + if ctr.State.Status == oci.ContainerStateRunning { containersOutput = append(containersOutput, ctr) } } @@ -295,10 +293,12 @@ func getTemplateOutput(containers []*libkpod.ContainerData, opts psOptions) (psO ns := getNamespaces(ctr.State.Pid) switch ctr.State.Status { - case "stopped": + case oci.ContainerStateStopped: status = "Exited (" + strconv.FormatInt(int64(ctr.State.ExitCode), 10) + ") " + runningFor + " ago" - case runningState: + case oci.ContainerStateRunning: status = "Up " + runningFor + " ago" + case oci.ContainerStatePaused: + status = "Paused" default: status = "Created" } @@ -385,7 +385,7 @@ func getJSONOutput(containers []*libkpod.ContainerData, nSpace bool) (psOutput [ Names: ctr.Name, Labels: ctr.Labels, Mounts: ctr.Mounts, - ContainerRunning: ctr.State.Status == runningState, + ContainerRunning: ctr.State.Status == oci.ContainerStateRunning, Namespaces: ns, } psOutput = append(psOutput, params) diff --git a/docs/kpod.1.md b/docs/kpod.1.md index 63a4e06b..fa409a3b 100644 --- a/docs/kpod.1.md +++ b/docs/kpod.1.md @@ -79,6 +79,9 @@ Display the logs of a container ### mount Mount a working container's root filesystem +### pause +Pause one or more containers + ### ps Prints out information about containers @@ -106,6 +109,9 @@ Display a live stream of one or more containers' resource usage statistics ### stop Stops one or more running containers. +### unpause +Unpause one or more containers + ### tag Add an additional name to a local image