diff --git a/runtime.md b/runtime.md index 1e4903a9d..3dfb861aa 100644 --- a/runtime.md +++ b/runtime.md @@ -22,6 +22,7 @@ The value MAY be one of: Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above. * **`pid`** (int, REQUIRED when `status` is `created` or `running`) is the ID of the container process, as seen by the host. +* **`exit`** (uint, REQUIRED when `status` is `stopped`) is the exit code of the container process. * **`bundlePath`** (string, REQUIRED) is the absolute path to the container's bundle directory. This is provided so that consumers can find the container's configuration and root filesystem on the host. * **`annotations`** (map, OPTIONAL) contains the list of annotations associated with the container. diff --git a/schema/state-schema.json b/schema/state-schema.json index 4a14f89bd..ca9a343f3 100644 --- a/schema/state-schema.json +++ b/schema/state-schema.json @@ -27,6 +27,11 @@ "type": "integer", "minimum": 0 }, + "exit": { + "id": "https://opencontainers.org/schema/runtime/state/exit", + "type": "integer", + "minimum": 0 + }, "bundlePath": { "id": "https://opencontainers.org/schema/runtime/state/bundlePath", "type": "string" diff --git a/specs-go/state.go b/specs-go/state.go index cecfa408e..5159c6a6a 100644 --- a/specs-go/state.go +++ b/specs-go/state.go @@ -10,6 +10,8 @@ type State struct { Status string `json:"status"` // Pid is the process ID for the container process. Pid int `json:"pid"` + // Exit is the exit code the container process. + Exit uint `json:"exit,omitempty"` // BundlePath is the path to the container's bundle directory. BundlePath string `json:"bundlePath"` // Annotations are the annotations associated with the container.