Change drvier name to append version
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
70a5cb95b3
commit
cdfebc2a20
|
@ -1,6 +1,7 @@
|
||||||
package chroot
|
package chroot
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/dotcloud/docker/execdriver"
|
"github.com/dotcloud/docker/execdriver"
|
||||||
"github.com/dotcloud/docker/mount"
|
"github.com/dotcloud/docker/mount"
|
||||||
"os"
|
"os"
|
||||||
|
@ -82,9 +83,5 @@ func (d *driver) Info(id string) execdriver.Info {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *driver) Name() string {
|
func (d *driver) Name() string {
|
||||||
return DriverName
|
return fmt.Sprintf("%s-%s", DriverName, Version)
|
||||||
}
|
|
||||||
|
|
||||||
func (d *driver) Version() string {
|
|
||||||
return Version
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
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
|
Kill(c *Process, sig int) error
|
||||||
Wait(id string) error // Wait on an out of process...process - lxc ghosts
|
Wait(id string) error // Wait on an out of process...process - lxc ghosts
|
||||||
Version() string // Driver version number
|
|
||||||
Name() string // Driver name
|
Name() string // Driver name
|
||||||
Info(id string) Info // "temporary" hack (until we move state from core to plugins)
|
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"`
|
Entrypoint string `json:"entrypoint"`
|
||||||
Arguments []string `json:"arguments"`
|
Arguments []string `json:"arguments"`
|
||||||
WorkingDir string `json:"working_dir"`
|
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"`
|
Tty bool `json:"tty"`
|
||||||
Network *Network `json:"network"` // if network is nil then networking is disabled
|
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"`
|
Cgroups *cgroups.Values `json:"cgroups"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,8 @@ func NewDriver(root string, apparmor bool) (*driver, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *driver) Name() string {
|
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) {
|
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 := ""
|
version := ""
|
||||||
if output, err := exec.Command("lxc-version").CombinedOutput(); err == nil {
|
if output, err := exec.Command("lxc-version").CombinedOutput(); err == nil {
|
||||||
outputStr := string(output)
|
outputStr := string(output)
|
||||||
|
|
|
@ -684,7 +684,7 @@ func (srv *Server) DockerInfo(job *engine.Job) engine.Status {
|
||||||
v.SetBool("Debug", os.Getenv("DEBUG") != "")
|
v.SetBool("Debug", os.Getenv("DEBUG") != "")
|
||||||
v.SetInt("NFd", utils.GetTotalUsedFds())
|
v.SetInt("NFd", utils.GetTotalUsedFds())
|
||||||
v.SetInt("NGoroutines", runtime.NumGoroutine())
|
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.SetInt("NEventsListener", len(srv.events))
|
||||||
v.Set("KernelVersion", kernelVersion)
|
v.Set("KernelVersion", kernelVersion)
|
||||||
v.Set("IndexServerAddress", auth.IndexServerAddress())
|
v.Set("IndexServerAddress", auth.IndexServerAddress())
|
||||||
|
|
Loading…
Reference in New Issue