Skip to content

Commit

Permalink
add --group-add
Browse files Browse the repository at this point in the history
  • Loading branch information
nexdrew committed May 21, 2020
1 parent 3475490 commit 4b2937d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -194,6 +194,7 @@ array.forEach((r) => {
| `HostConfig.UTSMode` | `--uts` |
| `HostConfig.RestartPolicy` | `--restart` |
| `HostConfig.ExtraHosts` | `--add-host` |
| `HostConfig.GroupAdd` | `--group-add` |
| `HostConfig.PidMode` | `--pid` |
| `HostConfig.SecurityOpt` | `--security-opt` |
| `Config.Hostname` | `-h` |
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -125,7 +125,7 @@ function toRunCommand (inspectObj, name) {
})
}
if (isCompatible('--add-host', modes)) rc = appendArray(rc, '--add-host', hostcfg.ExtraHosts)
// TODO hostcfg.GroupAdd
rc = appendArray(rc, '--group-add', hostcfg.GroupAdd)
if (hostcfg.PidMode) rc = append(rc, '--pid', hostcfg.PidMode)
rc = appendArray(rc, '--security-opt', hostcfg.SecurityOpt, quote)

Expand Down
6 changes: 5 additions & 1 deletion test/fixtures/inspect-one-two.json
Expand Up @@ -284,7 +284,11 @@
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"GroupAdd": [
"audio",
"nogroup",
"777"
],
"IpcMode": "",
"Cgroup": "",
"Links": null,
Expand Down
1 change: 1 addition & 0 deletions test/test-cli.js
Expand Up @@ -66,6 +66,7 @@ const expectedOneTwo = '\n' +
'--runtime nvidia ' +
'--volumes-from admiring_brown --volumes-from silly_jang ' +
'--restart no ' +
'--group-add audio --group-add nogroup --group-add 777 ' +
'-h 46d567b2ef86 ' +
'--domainname rekcod.xyz ' +
'-e \'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\' ' +
Expand Down

0 comments on commit 4b2937d

Please sign in to comment.