File: state.go

package info (click to toggle)
golang-github-opencontainers-specs 1.0.2.41.g7413a7f-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 468 kB
  • sloc: makefile: 122
file content (35 lines) | stat: -rw-r--r-- 1,240 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package specs

// ContainerState represents the state of a container.
type ContainerState string

const (
	// StateCreating indicates that the container is being created
	StateCreating ContainerState  = "creating"

	// StateCreated indicates that the runtime has finished the create operation
	StateCreated ContainerState  = "created"

	// StateRunning indicates that the container process has executed the
	// user-specified program but has not exited
	StateRunning ContainerState  = "running"

	// StateStopped indicates that the container process has exited
	StateStopped ContainerState  = "stopped"
)

// State holds information about the runtime state of the container.
type State struct {
	// Version is the version of the specification that is supported.
	Version string `json:"ociVersion"`
	// ID is the container ID
	ID string `json:"id"`
	// Status is the runtime status of the container.
	Status ContainerState `json:"status"`
	// Pid is the process ID for the container process.
	Pid int `json:"pid,omitempty"`
	// Bundle is the path to the container's bundle directory.
	Bundle string `json:"bundle"`
	// Annotations are key values associated with the container.
	Annotations map[string]string `json:"annotations,omitempty"`
}