diff --git a/execdriver/chroot/driver.go b/execdriver/chroot/driver.go index 2aa23c9866..f3eba8304d 100644 --- a/execdriver/chroot/driver.go +++ b/execdriver/chroot/driver.go @@ -1,6 +1,7 @@ package chroot import ( + "fmt" "github.com/dotcloud/docker/execdriver" "github.com/dotcloud/docker/mount" "os" @@ -82,9 +83,5 @@ func (d *driver) Info(id string) execdriver.Info { } func (d *driver) Name() string { - return DriverName -} - -func (d *driver) Version() string { - return Version + return fmt.Sprintf("%s-%s", DriverName, Version) } diff --git a/execdriver/driver.go b/execdriver/driver.go index 0141eef18d..7fc066ee29 100644 --- a/execdriver/driver.go +++ b/execdriver/driver.go @@ -63,7 +63,6 @@ type Driver interface { Run(c *Process, startCallback StartCallback) (int, error) // Run executes the process and blocks until the process exits and returns the exit code Kill(c *Process, sig int) error Wait(id string) error // Wait on an out of process...process - lxc ghosts - Version() string // Driver version number Name() string // Driver name Info(id string) Info // "temporary" hack (until we move state from core to plugins) } @@ -89,10 +88,10 @@ type Process struct { Entrypoint string `json:"entrypoint"` Arguments []string `json:"arguments"` WorkingDir string `json:"working_dir"` - ConfigPath string `json:"config_path"` // This should be able to be removed when the lxc template is moved into the driver + ConfigPath string `json:"config_path"` // this should be able to be removed when the lxc template is moved into the driver Tty bool `json:"tty"` Network *Network `json:"network"` // if network is nil then networking is disabled - Config []string `json:"config"` + Config []string `json:"config"` // generic values that specific drivers can consume Cgroups *cgroups.Values `json:"cgroups"` } diff --git a/execdriver/lxc/driver.go b/execdriver/lxc/driver.go index 09203dfbf1..6d1e1d29dc 100644 --- a/execdriver/lxc/driver.go +++ b/execdriver/lxc/driver.go @@ -68,7 +68,8 @@ func NewDriver(root string, apparmor bool) (*driver, error) { } func (d *driver) Name() string { - return DriverName + version := d.version() + return fmt.Sprintf("%s-%s", DriverName, version) } func (d *driver) Run(c *execdriver.Process, startCallback execdriver.StartCallback) (int, error) { @@ -186,7 +187,7 @@ func (d *driver) Wait(id string) error { } } -func (d *driver) Version() string { +func (d *driver) version() string { version := "" if output, err := exec.Command("lxc-version").CombinedOutput(); err == nil { outputStr := string(output) diff --git a/server.go b/server.go index bc8a86ef2f..a25ba74a06 100644 --- a/server.go +++ b/server.go @@ -684,7 +684,7 @@ func (srv *Server) DockerInfo(job *engine.Job) engine.Status { v.SetBool("Debug", os.Getenv("DEBUG") != "") v.SetInt("NFd", utils.GetTotalUsedFds()) v.SetInt("NGoroutines", runtime.NumGoroutine()) - v.Set("LXCVersion", srv.runtime.execDriver.Version()) + v.Set("ExecutionDriver", srv.runtime.execDriver.Name()) v.SetInt("NEventsListener", len(srv.events)) v.Set("KernelVersion", kernelVersion) v.Set("IndexServerAddress", auth.IndexServerAddress())