Skip to content

Commit 621684f

Browse files
committed
Rewrite LinuxIDMappings
Basicly make the format consistent with others, no semantics change. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
1 parent 81888fe commit 621684f

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

config-linux.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ If a new namespace is not created (because the namespace type is not listed, or
7373

7474
## User namespace mappings
7575

76+
**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container.
77+
**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container.
78+
79+
The following parameters can be specified:
80+
81+
* **`hostID`** (uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*.
82+
* **`containerID`** (uint32, REQUIRED)* - is the starting uid/gid in the container.
83+
* **`size`** (uint32, REQUIRED)* - is the number of ids to be mapped.
84+
85+
The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping.
86+
There is a limit of 5 mappings which is the Linux kernel hard limit.
87+
7688
###### Example
7789

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

95-
uid/gid mappings describe the user namespace mappings from the host to the container.
96-
The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping.
97-
*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.
98-
There is a limit of 5 mappings which is the Linux kernel hard limit.
99-
100107
## Devices
101108

102109
**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container.

specs-go/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ const (
187187

188188
// LinuxIDMapping specifies UID/GID mappings
189189
type LinuxIDMapping struct {
190-
// HostID is the UID/GID of the host user or group
190+
// HostID is the starting UID/GID on the host to be mapped to 'ContainerID'
191191
HostID uint32 `json:"hostID"`
192-
// ContainerID is the UID/GID of the container's user or group
192+
// ContainerID is the starting UID/GID in the container
193193
ContainerID uint32 `json:"containerID"`
194-
// Size is the length of the range of IDs mapped between the two namespaces
194+
// Size is the number of IDs to be mapped
195195
Size uint32 `json:"size"`
196196
}
197197

0 commit comments

Comments
 (0)