diff --git a/components/engine/network.go b/components/engine/network.go index 5ea76daaff..593ed6cab0 100644 --- a/components/engine/network.go +++ b/components/engine/network.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" "github.com/dotcloud/docker/iptables" - "github.com/dotcloud/docker/proxy" "github.com/dotcloud/docker/netlink" + "github.com/dotcloud/docker/proxy" "github.com/dotcloud/docker/utils" "log" "net" diff --git a/components/engine/runtime_test.go b/components/engine/runtime_test.go index fa167fd78e..a32f5c2679 100644 --- a/components/engine/runtime_test.go +++ b/components/engine/runtime_test.go @@ -95,7 +95,6 @@ func init() { startFds, startGoroutines = utils.GetTotalUsedFds(), runtime.NumGoroutine() } - func setupBaseImage() { config := &DaemonConfig{ GraphPath: unitTestStoreBase, @@ -123,7 +122,6 @@ func setupBaseImage() { } } - func spawnGlobalDaemon() { if globalRuntime != nil { utils.Debugf("Global runtime already exists. Skipping.") diff --git a/components/engine/server.go b/components/engine/server.go index 4f99c0f1d7..8e7a31ce9b 100644 --- a/components/engine/server.go +++ b/components/engine/server.go @@ -1216,6 +1216,9 @@ func (srv *Server) ContainerStart(name string, hostConfig *HostConfig) error { } childName := parts["name"] + if childName[0] != '/' { + childName = "/" + childName + } if err := runtime.Link(fmt.Sprintf("/%s", container.ID), childName, parts["alias"]); err != nil { return err } diff --git a/components/engine/state.go b/components/engine/state.go index 484032be36..af7de9f4da 100644 --- a/components/engine/state.go +++ b/components/engine/state.go @@ -9,12 +9,12 @@ import ( type State struct { sync.Mutex - Running bool - Pid int - ExitCode int - StartedAt time.Time + Running bool + Pid int + ExitCode int + StartedAt time.Time FinishedAt time.Time - Ghost bool + Ghost bool } // String returns a human-readable description of the state diff --git a/components/engine/utils_test.go b/components/engine/utils_test.go index d9efd90397..917c4c1591 100644 --- a/components/engine/utils_test.go +++ b/components/engine/utils_test.go @@ -1,15 +1,15 @@ package docker import ( - "github.com/dotcloud/docker/utils" "fmt" + "github.com/dotcloud/docker/utils" "io" "io/ioutil" "os" "path" + "runtime" "strings" "testing" - "runtime" ) // This file contains utility functions for docker's unit test suite. @@ -26,7 +26,7 @@ func mkRuntime(f Fataler) *Runtime { pc, _, _, _ := runtime.Caller(1) callerLongName := runtime.FuncForPC(pc).Name() parts := strings.Split(callerLongName, ".") - callerShortName := parts[len(parts) - 1] + callerShortName := parts[len(parts)-1] if globalTestID == "" { globalTestID = GenerateID()[:4] }