Skip to content

Commit

Permalink
Rewrite LinuxIDMappings
Browse files Browse the repository at this point in the history
Basicly make the format consistent with others, no
semantics change.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
  • Loading branch information
hqhq committed Oct 27, 2016
1 parent 81888fe commit 621684f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
17 changes: 12 additions & 5 deletions config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ If a new namespace is not created (because the namespace type is not listed, or

## User namespace mappings

**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container.
**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container.

The following parameters can be specified:

* **`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.
* **`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.
There is a limit of 5 mappings which is the Linux kernel hard limit.

###### Example

```json
Expand All @@ -92,11 +104,6 @@ If a new namespace is not created (because the namespace type is not listed, or
]
```

uid/gid mappings describe the user namespace mappings from the host to the container.
The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping.
*hostID* is the starting uid/gid on the host to be mapped to *containerID* which is the starting uid/gid in the container and *size* refers to the number of ids to be mapped.
There is a limit of 5 mappings which is the Linux kernel hard limit.

## Devices

**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container.
Expand Down
6 changes: 3 additions & 3 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ const (

// LinuxIDMapping specifies UID/GID mappings
type LinuxIDMapping struct {
// HostID is the UID/GID of the host user or group
// HostID is the starting UID/GID on the host to be mapped to 'ContainerID'
HostID uint32 `json:"hostID"`
// ContainerID is the UID/GID of the container's user or group
// ContainerID is the starting UID/GID in the container
ContainerID uint32 `json:"containerID"`
// Size is the length of the range of IDs mapped between the two namespaces
// Size is the number of IDs to be mapped
Size uint32 `json:"size"`
}

Expand Down

0 comments on commit 621684f

Please sign in to comment.