Skip to content

Commit 35ee63b

Browse files
committed
config: Make 'process.args' optional
Since be59415 (Split create and start, 2016-04-01, #384), it's possible for a container process to never execute user-specified code (e.g. you can call 'create', 'kill', 'delete' without calling 'start'). For folks who expect to do that, there's no reason to define process.args. The only other process property required for all platforms is 'cwd', but the runtime's idler code isn't specified in sufficient detail for the configuration author to have an opinion about what its working directory should be. On Linux and Solaris, 'user' is also required for 'uid' and 'gid'. My preferred approach here is to make those optional and define defaults [1,2]: If unset, the runtime will not attempt to manipulate the user ID (e.g. not calling setuid(2) or similar). But the maintainer consensus is that they want those to be explicitly required properties [3,4,5]. With the current spec, one option could be to make process optional (with the idler's working directory unspecified) for OSes besides Linux and Solaris. On Windows, username is optional, but it's not clear how intentional that was [6]. [1]: #417 (comment) [2]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/DWdystx5X3A Subject: Exposing platform defaults Date: Thu, 14 Jan 2016 15:36:26 -0800 Message-ID: <[email protected]> [3]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-04-17.00.log.html#l-44 [4]: #417 (comment) [5]: #417 (comment) [6]: #618 Signed-off-by: W. Trevor King <[email protected]>
1 parent cc983bb commit 35ee63b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [Se
128128
* **`env`** (array of strings, OPTIONAL) contains a list of variables that will be set in the process's environment prior to execution.
129129
Elements in the array are specified as Strings in the form "KEY=value".
130130
The left hand side MUST consist solely of letters, digits, and underscores `_` as outlined in [IEEE Std 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html).
131-
* **`args`** (array of strings, REQUIRED) executable to launch and any flags as an array.
131+
* **`args`** (array of strings, OPTIONAL) executable to launch and any flags as an array.
132132
The executable is the first element and MUST be available at the given path inside of the rootfs.
133133
If the executable path is not an absolute path then the search $PATH is interpreted to find the executable.
134134

runtime.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ This operation MUST generate an error if it is not provided the container ID.
103103
Attempting to start a container that does not exist MUST generate an error.
104104
Attempting to start an already started container MUST have no effect on the container and MUST generate an error.
105105
This operation MUST run the user-specified code as specified by [`process`](config.md#process-configuration).
106+
If `process.args` was not configured, the runtime MUST generate an error.
106107

107108
Upon successful completion of this operation the `status` property of this container MUST be `running`.
108109

schema/config-schema.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@
7474
"id": "https://opencontainers.org/schema/bundle/process",
7575
"type": "object",
7676
"required": [
77-
"cwd",
78-
"args"
77+
"cwd"
7978
],
8079
"properties": {
8180
"args": {

specs-go/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type Process struct {
3838
// User specifies user information for the process.
3939
User User `json:"user"`
4040
// Args specifies the binary and arguments for the application to execute.
41-
Args []string `json:"args"`
41+
Args []string `json:"args,omitempty"`
4242
// Env populates the process environment for the process.
4343
Env []string `json:"env,omitempty"`
4444
// Cwd is the current working directory for the process and must be

0 commit comments

Comments
 (0)