Fix missing "--version" argument

Commit 858b4b44c8172eb2c92767c8f624f4138db5212b added
support for obtaining the runtime version
if a custom path was set, but accidentally
removed the "--version" flag.

This patch restores the flag, and adds an integration
test to verify the behavior..

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6400ce8f0a97e456f9694396f58c0958f3580277
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2017-06-10 03:07:21 +02:00
parent 33135ac6fd
commit bf95ed2bb9
2 changed files with 23 additions and 1 deletions

View File

@ -38,7 +38,7 @@ func (daemon *Daemon) FillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
v.RuncCommit.Expected = dockerversion.RuncCommitID
defaultRuntimeBinary := daemon.configStore.GetRuntime(daemon.configStore.GetDefaultRuntimeName()).Path
if rv, err := exec.Command(defaultRuntimeBinary).Output(); err == nil {
if rv, err := exec.Command(defaultRuntimeBinary, "--version").Output(); err == nil {
parts := strings.Split(strings.TrimSpace(string(rv)), "\n")
if len(parts) == 3 {
parts = strings.Split(parts[1], ": ")