Skip to content

Commit 31c6569

Browse files
authored
Merge pull request #838 from wking/bump-path-requirement-to-root
config: Bump Hyper-V condition from root.path to root itself
2 parents d349388 + 767eeaf commit 31c6569

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

config.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,26 @@ For all platform-specific configuration values, the scope defined below in the [
2626

2727
## <a name="configRoot" />Root
2828

29-
**`root`** (object, REQUIRED) specifies the container's root filesystem.
29+
**`root`** (object, OPTIONAL) specifies the container's root filesystem.
30+
On Windows, for Windows Server Containers, this field is REQUIRED.
31+
For [Hyper-V Containers](config-windows.md#hyperv), this field MUST NOT be set.
3032

31-
* **`path`** (string, OPTIONAL) Specifies the path to the root filesystem for the container.
32-
The path is either an absolute path or a relative path to the bundle.
33+
On all other platforms, this field is REQUIRED.
3334

34-
* On Windows, for Windows Server Containers, this field is REQUIRED and MUST be specified as a [volume GUID path][naming-a-volume].
35-
For Hyper-V Containers, this field MUST be omitted.
36-
* On all other platforms, this field is REQUIRED.
35+
* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container.
36+
37+
* On Windows, `path` MUST be a [volume GUID path][naming-a-volume].
38+
39+
* On POSIX platforms, `path` is either an absolute path or a relative path to the bundle.
40+
For example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`.
3741
The value SHOULD be the conventional `rootfs`.
38-
* On Linux, for example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`.
3942

40-
If defined, a directory MUST exist at the path declared by the field.
43+
A directory MUST exist at the path declared by the field.
44+
4145
* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false.
4246
* On Windows, this field MUST be omitted or false.
4347

44-
### Example (POSIX)
48+
### Example (POSIX platforms)
4549

4650
```json
4751
"root": {
@@ -91,9 +95,9 @@ For all platform-specific configuration values, the scope defined below in the [
9195
]
9296
```
9397

94-
### <a name="configLinuxAndSolarisMounts" />Linux and Solaris Mounts
98+
### <a name="configPOSIXMounts" />POSIX-platform Mounts
9599

96-
For Linux and Solaris based systems the mounts structure has the following fields:
100+
For POSIX platforms the `mounts` structure has the following fields:
97101

98102
* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted.
99103
* Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
@@ -192,9 +196,9 @@ For Linux-based systems the process structure supports the following process-spe
192196

193197
The user for the process is a platform-specific structure that allows specific control over which user the process runs as.
194198

195-
#### <a name="configLinuxAndSolarisUser" />Linux and Solaris User
199+
#### <a name="configPOSIXUser" />POSIX-platform User
196200

197-
For Linux and Solaris based systems the user structure has the following fields:
201+
For POSIX platforms the `user` structure has the following fields:
198202

199203
* **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace).
200204
* **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace).
@@ -345,9 +349,9 @@ For Windows based systems the user structure has the following fields:
345349
}
346350
```
347351

348-
## <a name="configHooks" />Linux and Solaris Hooks
352+
## <a name="configHooks" />POSIX-platform Hooks
349353

350-
For Linux- and Solaris-based systems, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
354+
For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
351355

352356
* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties:
353357
* **`prestart`** (array of objects, OPTIONAL) is an array of [pre-start hooks](#prestart).

schema/config-schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"description": "Configures the container's root filesystem.",
4242
"id": "https://opencontainers.org/schema/bundle/root",
4343
"type": "object",
44+
"required": [
45+
"path"
46+
],
4447
"properties": {
4548
"path": {
4649
"id": "https://opencontainers.org/schema/bundle/root/path",
@@ -214,7 +217,6 @@
214217
}
215218
},
216219
"required": [
217-
"ociVersion",
218-
"root"
220+
"ociVersion"
219221
]
220222
}

specs-go/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Spec struct {
99
// Process configures the container process.
1010
Process *Process `json:"process,omitempty"`
1111
// Root configures the container's root filesystem.
12-
Root Root `json:"root"`
12+
Root *Root `json:"root,omitempty"`
1313
// Hostname configures the container's hostname.
1414
Hostname string `json:"hostname,omitempty"`
1515
// Mounts configures additional mounts (on top of Root).
@@ -94,7 +94,7 @@ type User struct {
9494
// Root contains information about the container's root filesystem on the host.
9595
type Root struct {
9696
// Path is the absolute path to the container's root filesystem.
97-
Path string `json:"path,omitempty"`
97+
Path string `json:"path"`
9898
// Readonly makes the root filesystem for the container readonly before the process is executed.
9999
Readonly bool `json:"readonly,omitempty"`
100100
}

0 commit comments

Comments
 (0)