Browse code

fix merge issue and gofmt

Victor Vieux authored on 2013/10/19 06:15:24
Showing 5 changed files
... ...
@@ -5,8 +5,8 @@ import (
5 5
 	"errors"
6 6
 	"fmt"
7 7
 	"github.com/dotcloud/docker/iptables"
8
-	"github.com/dotcloud/docker/proxy"
9 8
 	"github.com/dotcloud/docker/netlink"
9
+	"github.com/dotcloud/docker/proxy"
10 10
 	"github.com/dotcloud/docker/utils"
11 11
 	"log"
12 12
 	"net"
... ...
@@ -95,7 +95,6 @@ func init() {
95 95
 	startFds, startGoroutines = utils.GetTotalUsedFds(), runtime.NumGoroutine()
96 96
 }
97 97
 
98
-
99 98
 func setupBaseImage() {
100 99
 	config := &DaemonConfig{
101 100
 		GraphPath:   unitTestStoreBase,
... ...
@@ -123,7 +122,6 @@ func setupBaseImage() {
123 123
 	}
124 124
 }
125 125
 
126
-
127 126
 func spawnGlobalDaemon() {
128 127
 	if globalRuntime != nil {
129 128
 		utils.Debugf("Global runtime already exists. Skipping.")
... ...
@@ -1216,6 +1216,9 @@ func (srv *Server) ContainerStart(name string, hostConfig *HostConfig) error {
1216 1216
 			}
1217 1217
 
1218 1218
 			childName := parts["name"]
1219
+			if childName[0] != '/' {
1220
+				childName = "/" + childName
1221
+			}
1219 1222
 			if err := runtime.Link(fmt.Sprintf("/%s", container.ID), childName, parts["alias"]); err != nil {
1220 1223
 				return err
1221 1224
 			}
... ...
@@ -9,12 +9,12 @@ import (
9 9
 
10 10
 type State struct {
11 11
 	sync.Mutex
12
-	Running   bool
13
-	Pid       int
14
-	ExitCode  int
15
-	StartedAt time.Time
12
+	Running    bool
13
+	Pid        int
14
+	ExitCode   int
15
+	StartedAt  time.Time
16 16
 	FinishedAt time.Time
17
-	Ghost     bool
17
+	Ghost      bool
18 18
 }
19 19
 
20 20
 // String returns a human-readable description of the state
... ...
@@ -1,15 +1,15 @@
1 1
 package docker
2 2
 
3 3
 import (
4
-	"github.com/dotcloud/docker/utils"
5 4
 	"fmt"
5
+	"github.com/dotcloud/docker/utils"
6 6
 	"io"
7 7
 	"io/ioutil"
8 8
 	"os"
9 9
 	"path"
10
+	"runtime"
10 11
 	"strings"
11 12
 	"testing"
12
-	"runtime"
13 13
 )
14 14
 
15 15
 // This file contains utility functions for docker's unit test suite.
... ...
@@ -26,7 +26,7 @@ func mkRuntime(f Fataler) *Runtime {
26 26
 	pc, _, _, _ := runtime.Caller(1)
27 27
 	callerLongName := runtime.FuncForPC(pc).Name()
28 28
 	parts := strings.Split(callerLongName, ".")
29
-	callerShortName := parts[len(parts) - 1]
29
+	callerShortName := parts[len(parts)-1]
30 30
 	if globalTestID == "" {
31 31
 		globalTestID = GenerateID()[:4]
32 32
 	}