@@ -5,36 +5,12 @@ package main
5
5
import (
6
6
"encoding/json"
7
7
"os"
8
- "time"
9
8
10
9
"github.com/opencontainers/runc/libcontainer"
11
10
"github.com/opencontainers/runc/libcontainer/utils"
12
11
"github.com/urfave/cli"
13
12
)
14
13
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
-
38
14
var stateCommand = cli.Command {
39
15
Name : "state" ,
40
16
Usage : "output the state of a container" ,
@@ -61,7 +37,7 @@ instance of a container.`,
61
37
pid = 0
62
38
}
63
39
bundle , annotations := utils .Annotations (state .Config .Labels )
64
- cs := cState {
40
+ cs := containerState {
65
41
Version : state .BaseState .Config .Version ,
66
42
ID : state .BaseState .ID ,
67
43
InitProcessPid : pid ,
0 commit comments