Skip to content

Commit

Permalink
uidMappings: change order of fields for clarity
Browse files Browse the repository at this point in the history
"man 7 user_namespaces" explains the format of uid_map and gid_map:
    <containerID> <hostID> <mapSize>

The order of map entries in JSON does not matter. But for the clarity of
the spec, I find it easier to understand if the order of the JSON fields is
the same as the order of the fields in the underlying uid_map/gid_map
files.

I am about to file a PR in runtime-tools because the fields in
uid_map/gid_map were parsed in the wrong order.

Signed-off-by: Alban Crequy <alban@kinvolk.io>
  • Loading branch information
alban committed Mar 8, 2018
1 parent fa4b36a commit 1d4e354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ If a `namespaces` field contains duplicated namespaces with same `type`, the run

Each entry has the following structure:

* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*.
* **`containerID`** *(uint32, REQUIRED)* - is the starting uid/gid in the container.
* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*.
* **`size`** *(uint32, REQUIRED)* - is the number of ids to be mapped.

The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping.
Expand All @@ -94,15 +94,15 @@ Note that the number of mapping entries MAY be limited by the [kernel][user-name
```json
"uidMappings": [
{
"hostID": 1000,
"containerID": 0,
"hostID": 1000,
"size": 32000
}
],
"gidMappings": [
{
"hostID": 1000,
"containerID": 0,
"hostID": 1000,
"size": 32000
}
]
Expand Down

0 comments on commit 1d4e354

Please sign in to comment.