Skip to content

Commit 440fc5b

Browse files
wkingvbatts
authored andcommitted
specs-go/config: Make Spec.Mounts omitempty (#408)
* specs-go/config: Make Spec.Mounts omitempty Otherwise: $ ocitools generate --mount-cgroups=no --template <(echo {}) $ grep mounts config.json "mounts": null, The language in config.md#Mounts is: > You can add array of mount points... which I think means 'MAY'. Signed-off-by: W. Trevor King <[email protected]> * config: Use 'MAY' (RFC 2119) for mounts Signed-off-by: W. Trevor King <[email protected]>
1 parent e6427cb commit 440fc5b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Each container has exactly one *root filesystem*, specified in the *root* object
3939

4040
## Mounts
4141

42-
You can add array of mount points inside container as `mounts`.
42+
You MAY add array of mount points inside container as `mounts`.
4343
The runtime MUST mount entries in the listed order.
4444
The parameters are similar to the ones in [the Linux mount system call](http://man7.org/linux/man-pages/man2/mount.2.html).
4545

specs-go/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Spec struct {
1717
// Hostname is the container's host name.
1818
Hostname string `json:"hostname,omitempty"`
1919
// Mounts profile configuration for adding mounts to the container's filesystem.
20-
Mounts []Mount `json:"mounts"`
20+
Mounts []Mount `json:"mounts,omitempty"`
2121
// Hooks are the commands run at various lifecycle events of the container.
2222
Hooks Hooks `json:"hooks"`
2323
// Annotations is an unstructured key value map that may be set by external tools to store and retrieve arbitrary metadata.

0 commit comments

Comments
 (0)