Skip to content

Commit 72c1f0b

Browse files
authored
Merge pull request #1143 from AlexeyPerevalov/IdMapMounts
IDMapping field for mount point
2 parents 2792412 + 9d1130d commit 72c1f0b

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

config.md

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ For POSIX platforms the `mounts` structure has the following fields:
101101
* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted.
102102
* Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*).
103103
* Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m].
104+
* **`uidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert UIDs from the source file system to the destination mount point.\
105+
The format is the same as [user namespace mappings](config-linux.md#user-namespace-mappings).
106+
* **`gidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert GIDs from the source file system to the destination mount point.
107+
For more details see `uidMappings`.
108+
104109

105110
### Example (Linux)
106111

schema/defs.json

+12
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@
141141
},
142142
"type": {
143143
"type": "string"
144+
},
145+
"uidMappings": {
146+
"type": "array",
147+
"items": {
148+
"$ref": "#/definitions/IDMapping"
149+
}
150+
},
151+
"gidMappings": {
152+
"type": "array",
153+
"items": {
154+
"$ref": "#/definitions/IDMapping"
155+
}
144156
}
145157
},
146158
"required": [

specs-go/config.go

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ type Mount struct {
117117
Source string `json:"source,omitempty"`
118118
// Options are fstab style mount options.
119119
Options []string `json:"options,omitempty"`
120+
121+
// UID/GID mappings used for changing file owners w/o calling chown, fs should support it.
122+
// Every mount point could have its own mapping.
123+
UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty" platform:"linux"`
124+
GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty" platform:"linux"`
120125
}
121126

122127
// Hook specifies a command that is run at a particular event in the lifecycle of a container

0 commit comments

Comments
 (0)