Skip to content

Commit a23a5c8

Browse files
committed
config: platform dependent user attributes
This introduces verbiage of fields that may occur in json (technically optional), but is required on certain platforms (e.g. Linux). Not adding a "name" string, as that is not a requirement yet. In the event a windows runtime shows up, I could imagine an `sid`, but we'll get to that when it happens. Closes #135 Related to #166 Signed-off-by: Vincent Batts <[email protected]>
1 parent 52cbf47 commit a23a5c8

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

config.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ type Process struct {
3333
Cwd string `json:"cwd"`
3434
}
3535

36+
// User specifies linux specific user and group information for the container's
37+
// main process.
38+
type User struct {
39+
// UID is the user ID the Process is executed as. (this field is platform dependent)
40+
UID uint32 `json:"uid,omitempty"`
41+
// GID is the group ID the Process is executed as. (this field is platform dependent)
42+
GID uint32 `json:"gid,omitempty"`
43+
// AdditionalGids are additional group ids set for the container's process. (this field is platform dependent)
44+
AdditionalGids []uint32 `json:"additionalGids,omitempty"`
45+
}
46+
3647
// Root contains information about the container's root filesystem on the host.
3748
type Root struct {
3849
// Path is the absolute path to the container's root filesystem.

config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ The runtime MUST mount entries in the listed order.
7676
The user for the process is a platform-specific structure that allows specific control over which user the process runs as.
7777
For Linux-based systems the user structure has the following fields:
7878

79-
* **`uid`** (int, required) specifies the user id.
80-
* **`gid`** (int, required) specifies the group id.
81-
* **`additionalGids`** (array of ints, optional) specifies additional group ids to be added to the process.
79+
* **`uid`** (int, required on Linux) specifies the user id.
80+
* **`gid`** (int, required on Linux) specifies the group id.
81+
* **`additionalGids`** (array of ints, optional on Linux) specifies additional group ids to be added to the process.
8282

8383
*Example (Linux)*
8484

config_linux.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,3 @@ type Linux struct {
1212
// Capabilities are linux capabilities that are kept for the container.
1313
Capabilities []string `json:"capabilities"`
1414
}
15-
16-
// User specifies linux specific user and group information for the container's
17-
// main process.
18-
type User struct {
19-
// UID is the user id.
20-
UID uint32 `json:"uid"`
21-
// GID is the group id.
22-
GID uint32 `json:"gid"`
23-
// AdditionalGids are additional group ids set for the container's process.
24-
AdditionalGids []uint32 `json:"additionalGids,omitempty"`
25-
}

0 commit comments

Comments
 (0)