Skip to content

Commit 73bf1ba

Browse files
committed
JSON objects are easier to parse/manipulate
Don't use strings when you can use dictionaries/objects. JSON objects are trivial to parse and manipulate, unlike strings. String parsing is the #1 cause of security bugs, so if it can be trivially avoided, then why not ;)
1 parent d581213 commit 73bf1ba

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

runtime-config.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Additional filesystems can be declared as "mounts", specified in the *mounts* ar
55
* **type** (string, required) Linux, *filesystemtype* argument supported by the kernel are listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). Windows: ntfs
66
* **source** (string, required) a device name, but can also be a directory name or a dummy. Windows, the volume name that is the target of the mount point. \\?\Volume\{GUID}\ (on Windows source is called target)
77
* **destination** (string, required) where the source filesystem is mounted relative to the container rootfs.
8-
* **options** (string, optional) in the fstab format [https://wiki.archlinux.org/index.php/Fstab](https://wiki.archlinux.org/index.php/Fstab).
8+
* **options** (list of strings, optional) in the fstab format [https://wiki.archlinux.org/index.php/Fstab](https://wiki.archlinux.org/index.php/Fstab).
99

1010
*Example (Linux)*
1111

@@ -15,25 +15,25 @@ Additional filesystems can be declared as "mounts", specified in the *mounts* ar
1515
"type": "proc",
1616
"source": "proc",
1717
"destination": "/proc",
18-
"options": ""
18+
"options": []
1919
},
2020
{
2121
"type": "tmpfs",
2222
"source": "tmpfs",
2323
"destination": "/dev",
24-
"options": "nosuid,strictatime,mode=755,size=65536k"
24+
"options": ["nosuid","strictatime","mode=755","size=65536k"]
2525
},
2626
{
2727
"type": "devpts",
2828
"source": "devpts",
2929
"destination": "/dev/pts",
30-
"options": "nosuid,noexec,newinstance,ptmxmode=0666,mode=0620,gid=5"
30+
"options": ["nosuid","noexec","newinstance","ptmxmode=0666","mode=0620","gid=5"]
3131
},
3232
{
3333
"type": "bind",
3434
"source": "/volumes/testing",
3535
"destination": "/data",
36-
"options": "rbind,rw"
36+
"options": ["rbind","rw"]
3737
}
3838
]
3939
```
@@ -46,11 +46,12 @@ Additional filesystems can be declared as "mounts", specified in the *mounts* ar
4646
"type": "ntfs",
4747
"source": "\\\\?\\Volume\\{2eca078d-5cbc-43d3-aff8-7e8511f60d0e}\\",
4848
"destination": "C:\\Users\\crosbymichael\\My Fancy Mount Point\\",
49-
"options": ""
49+
"options": []
5050
}
5151
]
5252
```
5353

5454
See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [SetVolumeMountPoint](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365561(v=vs.85).aspx) in Windows.
5555

5656

57+

runtime_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ type Mount struct {
3232
// Destination is the path where the mount will be placed relative to the container's root.
3333
Destination string `json:"destination"`
3434
// Options are fstab style mount options.
35-
Options string `json:"options"`
35+
Options []string `json:"options"`
3636
}

0 commit comments

Comments
 (0)