Skip to content

Commit

Permalink
runtime: Only require 'pid' in the state for created/running statuses
Browse files Browse the repository at this point in the history
Because during the 'creating' phase we may not have a container
process yet (e.g. if we're still reading the configuration or setting
up cgroups), and in the 'stopped' phase the PID is no longer
meaningful.

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Jan 6, 2017
1 parent fd2e95c commit cfc27a8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Whether other entities using the same, or other, instance of the runtime can see

## State

The state of a container MUST include, at least, the following properties:
The state of a container includes the following properties:

* **`ociVersion`**: (string) is the OCI specification version used when creating the container.
* **`id`**: (string) is the container's ID.
* **`ociVersion`** (string, REQUIRED) is the OCI specification version used when creating the container.
* **`id`** (string, REQUIRED) is the container's ID.
This MUST be unique across all containers on this host.
There is no requirement that it be unique across hosts.
* **`status`**: (string) is the runtime state of the container.
* **`status`** (string, REQUIRED) is the runtime state of the container.
The value MAY be one of:

* `creating`: the container is being created (step 2 in the [lifecycle](#lifecycle))
Expand All @@ -22,12 +22,14 @@ The value MAY be one of:
* `stopped`: the container process has exited (step 5 in the [lifecycle](#lifecycle))

Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above.
* **`pid`**: (int) is the ID of the container process, as seen by the host.
* **`bundlePath`**: (string) is the absolute path to the container's bundle directory.
* **`pid`** (int, REQUIRED when `status` is `created` or `running`) is the ID of the container process, as seen by the host.
* **`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) contains the list of annotations associated with the container.
* **`annotations`**: (map, OPTIONAL) contains the list of annotations associated with the container.
If no annotations were provided then this property MAY either be absent or an empty map.

The state MAY include additional properties.

When serialized in JSON, the format MUST adhere to the following pattern:

```json
Expand Down

0 comments on commit cfc27a8

Please sign in to comment.