Browse code

Change drvier name to append version

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby authored on 2014/01/17 04:59:46
Showing 4 changed files
... ...
@@ -1,6 +1,7 @@
1 1
 package chroot
2 2
 
3 3
 import (
4
+	"fmt"
4 5
 	"github.com/dotcloud/docker/execdriver"
5 6
 	"github.com/dotcloud/docker/mount"
6 7
 	"os"
... ...
@@ -82,9 +83,5 @@ func (d *driver) Info(id string) execdriver.Info {
82 82
 }
83 83
 
84 84
 func (d *driver) Name() string {
85
-	return DriverName
86
-}
87
-
88
-func (d *driver) Version() string {
89
-	return Version
85
+	return fmt.Sprintf("%s-%s", DriverName, Version)
90 86
 }
... ...
@@ -63,7 +63,6 @@ type Driver interface {
63 63
 	Run(c *Process, startCallback StartCallback) (int, error) // Run executes the process and blocks until the process exits and returns the exit code
64 64
 	Kill(c *Process, sig int) error
65 65
 	Wait(id string) error // Wait on an out of process...process - lxc ghosts
66
-	Version() string      // Driver version number
67 66
 	Name() string         // Driver name
68 67
 	Info(id string) Info  // "temporary" hack (until we move state from core to plugins)
69 68
 }
... ...
@@ -89,10 +88,10 @@ type Process struct {
89 89
 	Entrypoint string          `json:"entrypoint"`
90 90
 	Arguments  []string        `json:"arguments"`
91 91
 	WorkingDir string          `json:"working_dir"`
92
-	ConfigPath string          `json:"config_path"` // This should be able to be removed when the lxc template is moved into the driver
92
+	ConfigPath string          `json:"config_path"` // this should be able to be removed when the lxc template is moved into the driver
93 93
 	Tty        bool            `json:"tty"`
94 94
 	Network    *Network        `json:"network"` // if network is nil then networking is disabled
95
-	Config     []string        `json:"config"`
95
+	Config     []string        `json:"config"`  //  generic values that specific drivers can consume
96 96
 	Cgroups    *cgroups.Values `json:"cgroups"`
97 97
 }
98 98
 
... ...
@@ -68,7 +68,8 @@ func NewDriver(root string, apparmor bool) (*driver, error) {
68 68
 }
69 69
 
70 70
 func (d *driver) Name() string {
71
-	return DriverName
71
+	version := d.version()
72
+	return fmt.Sprintf("%s-%s", DriverName, version)
72 73
 }
73 74
 
74 75
 func (d *driver) Run(c *execdriver.Process, startCallback execdriver.StartCallback) (int, error) {
... ...
@@ -186,7 +187,7 @@ func (d *driver) Wait(id string) error {
186 186
 	}
187 187
 }
188 188
 
189
-func (d *driver) Version() string {
189
+func (d *driver) version() string {
190 190
 	version := ""
191 191
 	if output, err := exec.Command("lxc-version").CombinedOutput(); err == nil {
192 192
 		outputStr := string(output)
... ...
@@ -684,7 +684,7 @@ func (srv *Server) DockerInfo(job *engine.Job) engine.Status {
684 684
 	v.SetBool("Debug", os.Getenv("DEBUG") != "")
685 685
 	v.SetInt("NFd", utils.GetTotalUsedFds())
686 686
 	v.SetInt("NGoroutines", runtime.NumGoroutine())
687
-	v.Set("LXCVersion", srv.runtime.execDriver.Version())
687
+	v.Set("ExecutionDriver", srv.runtime.execDriver.Name())
688 688
 	v.SetInt("NEventsListener", len(srv.events))
689 689
 	v.Set("KernelVersion", kernelVersion)
690 690
 	v.Set("IndexServerAddress", auth.IndexServerAddress())