Skip to content

Commit 5246151

Browse files
author
Michael Crosby
committed
Make mount type and source optional
These are optional on multiple platforms and should be left up to the runtime/host system for validation. Closes opencontainers#470 Signed-off-by: Michael Crosby <[email protected]>
1 parent ae7a541 commit 5246151

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ For Windows, see links for details about [mountvol](http://ss64.com/nt/mountvol.
5757
This value MUST be an absolute path.
5858
* Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar).
5959
* Solaris: corresponds to "dir" of the fs resource in zonecfg(8).
60-
* **`type`** (string, REQUIRED) The filesystem type of the filesystem to be mounted.
60+
* **`type`** (string, OPTIONAL) The filesystem type of the filesystem to be mounted.
6161
* Linux: valid *filesystemtype* supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
6262
* Windows: the type of file system on the volume, e.g. "ntfs".
6363
* Solaris: corresponds to "type" of the fs resource in zonecfg(8).
64-
* **`source`** (string, REQUIRED) A device name, but can also be a directory name or a dummy.
64+
* **`source`** (string, OPTIONAL) A device name, but can also be a directory name or a dummy.
6565
* Windows: the volume name that is the target of the mount point, \\?\Volume\{GUID}\ (on Windows source is called target).
6666
* Solaris: corresponds to "special" of the fs resource in zonecfg(8).
6767
* **`options`** (list of strings, OPTIONAL) Mount options of the filesystem to be used.

schema/defs.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@
140140
}
141141
},
142142
"required": [
143-
"destination",
144-
"source",
145-
"type"
143+
"destination"
146144
]
147145
},
148146
"ociVersion": {

specs-go/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ type Mount struct {
113113
// Destination is the path where the mount will be placed relative to the container's root. The path and child directories MUST exist, a runtime MUST NOT create directories automatically to a mount point.
114114
Destination string `json:"destination"`
115115
// Type specifies the mount kind.
116-
Type string `json:"type"`
116+
Type string `json:"type,omitempty"`
117117
// Source specifies the source path of the mount. In the case of bind mounts on
118118
// Linux based systems this would be the file on the host.
119-
Source string `json:"source"`
119+
Source string `json:"source,omitempty"`
120120
// Options are fstab style mount options.
121121
Options []string `json:"options,omitempty"`
122122
}

0 commit comments

Comments
 (0)