Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: do not require pid while created #895

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` under 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.
Expand Down
1 change: 0 additions & 1 deletion schema/state-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"ociVersion",
"id",
"status",
"pid",
"bundle"
]
}
2 changes: 1 addition & 1 deletion specs-go/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be to leave off the pointer and use omitempty, since zero isn't a valid PID. Which way we should go depends on the unresolved #772, but the maintainers may have a one-off opinion on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be to leave off the pointer and use omitempty

#897 is currently going this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked to @crosbymichael offline. He's going to carry this. I'll close this PR in favour of #897

// Bundle is the path to the container's bundle directory.
Bundle string `json:"bundle"`
// Annotations are key values associated with the container.
Expand Down