Skip to content

Commit

Permalink
merge #1219 into main
Browse files Browse the repository at this point in the history
Rodrigo Campos (1):
  features-linux: Expose idmap information

LGTMs: guiseppe AkihiroSuda cyphar
Closes #1219
  • Loading branch information
cyphar committed Aug 23, 2023
2 parents e8c4134 + f329913 commit 4fec88f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
19 changes: 19 additions & 0 deletions features-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,22 @@ Irrelevant to the availability of Intel RDT on the host operating system.
"enabled": true
}
```

## <a name="linuxFeaturesMountExtensions" />MountExtensions

**`mountExtensions`** (object, OPTIONAL) represents whether the runtime supports certain mount features, irrespective of the availability of the features on the host operating system.

* **`idmap`** (object, OPTIONAL) represents whether the runtime supports idmap mounts using the `uidMappings` and `gidMappings` properties of the mount.
* **`enabled`** (bool, OPTIONAL) represents whether the runtime parses and attempts to use the `uidMappings` and `gidMappings` properties of mounts if provided.
Note that it is possible for runtimes to have partial implementations of id-mapped mounts support (such as only allowing mounts which have mappings matching the container's user namespace, or only allowing the id-mapped bind-mounts).
In such cases, runtimes MUST still set this value to `true`, to indicate that the runtime recognises the `uidMappings` and `gidMappings` properties.

### Example

```json
"mountExtensions": {
"idmap":{
"enabled": true
}
}
```
13 changes: 13 additions & 0 deletions schema/features-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@
"type": "boolean"
}
}
},
"mountExtensions": {
"type": "object",
"properties": {
"idmap": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
}
}
}
}
}
Expand Down
24 changes: 19 additions & 5 deletions specs-go/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ type Linux struct {
// Nil value means "unknown", not "no support for any capability".
Capabilities []string `json:"capabilities,omitempty"`

Cgroup *Cgroup `json:"cgroup,omitempty"`
Seccomp *Seccomp `json:"seccomp,omitempty"`
Apparmor *Apparmor `json:"apparmor,omitempty"`
Selinux *Selinux `json:"selinux,omitempty"`
IntelRdt *IntelRdt `json:"intelRdt,omitempty"`
Cgroup *Cgroup `json:"cgroup,omitempty"`
Seccomp *Seccomp `json:"seccomp,omitempty"`
Apparmor *Apparmor `json:"apparmor,omitempty"`
Selinux *Selinux `json:"selinux,omitempty"`
IntelRdt *IntelRdt `json:"intelRdt,omitempty"`
MountExtensions *MountExtensions `json:"mountExtensions,omitempty"`
}

// Cgroup represents the "cgroup" field.
Expand Down Expand Up @@ -123,3 +124,16 @@ type IntelRdt struct {
// Nil value means "unknown", not "false".
Enabled *bool `json:"enabled,omitempty"`
}

// MountExtensions represents the "mountExtensions" field.
type MountExtensions struct {
// IDMap represents the status of idmap mounts support.
IDMap *IDMap `json:"idmap,omitempty"`
}

type IDMap struct {
// Enabled represents whether idmap mounts supports is compiled in.
// Unrelated to whether the host supports it or not.
// Nil value means "unknown", not "false".
Enabled *bool `json:"enabled,omitempty"`
}

0 comments on commit 4fec88f

Please sign in to comment.