You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config-linux: Convert linux.namespaces from an array to an object
Namespaces do not need repeated entries and the ordering is handled by
the runtime regardless of the spec ordering (e.g. in runC [1]). Using
an object leans on the new wording from eeaccfa (glossary: Make
objects explicitly unordered and forbid duplicate names, 2016-09-27,
#584) to make both of those points explicit.
[1]: opencontainers/runc#977
Subject: nsenter: guarantee correct user namespace ordering
Signed-off-by: W. Trevor King <wking@tremily.us>
Copy file name to clipboardExpand all lines: config-linux.md
+14-25Lines changed: 14 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,9 @@ A namespace wraps a global system resource in an abstraction that makes it appea
23
23
Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes.
24
24
For more information, see [the man page](http://man7.org/linux/man-pages/man7/namespaces.7.html).
25
25
26
-
Namespaces are specified as an array of entries inside the `namespaces` root field.
27
-
The following parameters can be specified to setup namespaces:
26
+
***`namespaces`** (object, OPTIONAL) specifies the container namespaces.
27
+
Valid keys are:
28
28
29
-
***`type`***(string, REQUIRED)* - namespace type. The following namespaces types are supported:
30
29
***`pid`** processes inside the container will only be able to see other processes inside the same container.
31
30
***`network`** the container will have its own network stack.
32
31
***`mount`** the container will have an isolated mount table.
@@ -35,39 +34,29 @@ The following parameters can be specified to setup namespaces:
35
34
***`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container.
36
35
***`cgroup`** the container will have an isolated view of the cgroup hierarchy.
37
36
38
-
***`path`***(string, OPTIONAL)* - path to namespace file in the [runtime mount namespace](glossary.md#runtime-namespace)
37
+
Values have the following properties:
38
+
39
+
***`path`***(string, OPTIONAL)* - path to namespace file in the [runtime mount namespace](glossary.md#runtime-namespace)
39
40
40
41
If a path is specified, that particular file is used to join that type of namespace.
41
-
If a namespace type is not specified in the `namespaces`array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type.
42
+
If a namespace type is not specified in the `namespaces`object, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type.
42
43
If a new namespace is not created (because the namespace type is not listed, or because it is listed with a `path`), runtimes MUST assume that the setup for that namespace has already been done and error out if the config specifies anything else related to that namespace.
0 commit comments