Skip to content

Commit

Permalink
Change drvier name to append version
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
  • Loading branch information
crosbymichael committed Jan 18, 2014
1 parent 70a5cb9 commit cdfebc2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
7 changes: 2 additions & 5 deletions execdriver/chroot/driver.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package chroot

import (
"fmt"
"github.com/dotcloud/docker/execdriver"
"github.com/dotcloud/docker/mount"
"os"
Expand Down Expand Up @@ -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)
}
5 changes: 2 additions & 3 deletions execdriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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"`
}

Expand Down
5 changes: 3 additions & 2 deletions execdriver/lxc/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit cdfebc2

Please sign in to comment.