From d3c8849b0746a2f0a48554808ecd7c376c200dad Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 12 Jul 2017 15:30:53 -0700 Subject: [PATCH] Make pid option on platforms other than linux Signed-off-by: Michael Crosby --- runtime.md | 2 +- schema/state-schema.json | 1 - specs-go/state.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime.md b/runtime.md index eed634dc2..f0e81648f 100644 --- a/runtime.md +++ b/runtime.md @@ -22,7 +22,7 @@ The state of a container includes the following properties: * `stopped`: the container process has exited (step 7 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, REQUIRED when `status` is `created` or `running`) is the ID of the container process, as seen by the host. +* **`pid`** (int, REQUIRED when `status` is `created` or `running` on Linux, OPTIONAL on other platforms) is the ID of the container process, as seen by the host. * **`bundle`** (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 74544980f..563a619f0 100644 --- a/schema/state-schema.json +++ b/schema/state-schema.json @@ -40,7 +40,6 @@ "ociVersion", "id", "status", - "pid", "bundle" ] } diff --git a/specs-go/state.go b/specs-go/state.go index b5dd3bee8..89dce34be 100644 --- a/specs-go/state.go +++ b/specs-go/state.go @@ -9,7 +9,7 @@ type State struct { // Status is the runtime status of the container. Status string `json:"status"` // Pid is the process ID for the container process. - Pid int `json:"pid"` + 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.