@@ -5,36 +5,12 @@ package main
55import (
66 "encoding/json"
77 "os"
8- "time"
98
109 "github.com/opencontainers/runc/libcontainer"
1110 "github.com/opencontainers/runc/libcontainer/utils"
1211 "github.com/urfave/cli"
1312)
1413
15- // cState represents the platform agnostic pieces relating to a running
16- // container's status and state. Note: The fields in this structure adhere to
17- // the opencontainers/runtime-spec/specs-go requirement for json fields that must be returned
18- // in a state command.
19- type cState struct {
20- // Version is the OCI version for the container
21- Version string `json:"ociVersion"`
22- // ID is the container ID
23- ID string `json:"id"`
24- // InitProcessPid is the init process id in the parent namespace
25- InitProcessPid int `json:"pid"`
26- // Bundle is the path on the filesystem to the bundle
27- Bundle string `json:"bundlePath"`
28- // Rootfs is a path to a directory containing the container's root filesystem.
29- Rootfs string `json:"rootfsPath"`
30- // Status is the current status of the container, running, paused, ...
31- Status string `json:"status"`
32- // Created is the unix timestamp for the creation time of the container in UTC
33- Created time.Time `json:"created"`
34- // Annotations is the user defined annotations added to the config.
35- Annotations map [string ]string `json:"annotations,omitempty"`
36- }
37-
3814var stateCommand = cli.Command {
3915 Name : "state" ,
4016 Usage : "output the state of a container" ,
@@ -61,7 +37,7 @@ instance of a container.`,
6137 pid = 0
6238 }
6339 bundle , annotations := utils .Annotations (state .Config .Labels )
64- cs := cState {
40+ cs := containerState {
6541 Version : state .BaseState .Config .Version ,
6642 ID : state .BaseState .ID ,
6743 InitProcessPid : pid ,
0 commit comments