Fix go vet warnings
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
This commit is contained in:
parent
64579f51fc
commit
391c35c822
8 changed files with 24 additions and 13 deletions
|
@ -64,7 +64,12 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
|
|||
}
|
||||
c.Terminal = term
|
||||
|
||||
c.Mounts = append(c.Mounts, execdriver.Mount{d.initPath, c.InitPath, false, true})
|
||||
c.Mounts = append(c.Mounts, execdriver.Mount{
|
||||
Source: d.initPath,
|
||||
Destination: c.InitPath,
|
||||
Writable: false,
|
||||
Private: true,
|
||||
})
|
||||
|
||||
if err := d.generateEnvConfig(c); err != nil {
|
||||
return -1, err
|
||||
|
@ -440,7 +445,12 @@ func (d *driver) generateEnvConfig(c *execdriver.Command) error {
|
|||
return err
|
||||
}
|
||||
p := path.Join(d.root, "containers", c.ID, "config.env")
|
||||
c.Mounts = append(c.Mounts, execdriver.Mount{p, "/.dockerenv", false, true})
|
||||
c.Mounts = append(c.Mounts, execdriver.Mount{
|
||||
Source: p,
|
||||
Destination: "/.dockerenv",
|
||||
Writable: false,
|
||||
Private: true,
|
||||
})
|
||||
|
||||
return ioutil.WriteFile(p, data, 0600)
|
||||
}
|
||||
|
|
|
@ -61,6 +61,6 @@ func initializer() {
|
|||
}
|
||||
|
||||
func writeError(err error) {
|
||||
fmt.Sprint(os.Stderr, err)
|
||||
fmt.Fprint(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ func (daemon *Daemon) ContainerLogs(job *engine.Job) engine.Status {
|
|||
var err error
|
||||
lines, err = strconv.Atoi(tail)
|
||||
if err != nil {
|
||||
utils.Errorf("Failed to parse tail %s, error: %v, show all logs", err)
|
||||
utils.Errorf("Failed to parse tail %s, error: %v, show all logs", tail, err)
|
||||
lines = -1
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package portmapper
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/daemon/networkdriver/portallocator"
|
||||
"github.com/docker/docker/pkg/iptables"
|
||||
"github.com/docker/docker/pkg/proxy"
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -138,7 +139,7 @@ func TestMapAllPortsSingleInterface(t *testing.T) {
|
|||
}
|
||||
|
||||
if _, err := Map(srcAddr1, dstIp1, portallocator.BeginPortRange); err == nil {
|
||||
t.Fatal("Port %d should be bound but is not", portallocator.BeginPortRange)
|
||||
t.Fatalf("Port %d should be bound but is not", portallocator.BeginPortRange)
|
||||
}
|
||||
|
||||
for _, val := range hosts {
|
||||
|
|
|
@ -37,7 +37,7 @@ func TestStateRunStop(t *testing.T) {
|
|||
t.Fatalf("Pid %v, expected %v", runPid, i+100)
|
||||
}
|
||||
if pid, err := s.WaitRunning(-1 * time.Second); err != nil || pid != i+100 {
|
||||
t.Fatal("WaitRunning returned pid: %v, err: %v, expected pid: %v, err: %v", pid, err, i+100, nil)
|
||||
t.Fatalf("WaitRunning returned pid: %v, err: %v, expected pid: %v, err: %v", pid, err, i+100, nil)
|
||||
}
|
||||
|
||||
stopped := make(chan struct{})
|
||||
|
@ -68,7 +68,7 @@ func TestStateRunStop(t *testing.T) {
|
|||
t.Fatalf("ExitCode %v, expected %v", exitCode, i)
|
||||
}
|
||||
if exitCode, err := s.WaitStop(-1 * time.Second); err != nil || exitCode != i {
|
||||
t.Fatal("WaitStop returned exitCode: %v, err: %v, expected exitCode: %v, err: %v", exitCode, err, i, nil)
|
||||
t.Fatalf("WaitStop returned exitCode: %v, err: %v, expected exitCode: %v, err: %v", exitCode, err, i, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1836,7 +1836,7 @@ func TestBuildFromGIT(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
if res != "docker" {
|
||||
t.Fatal("Maintainer should be docker, got %s", res)
|
||||
t.Fatalf("Maintainer should be docker, got %s", res)
|
||||
}
|
||||
logDone("build - build from GIT")
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ func TestCLIGetEventsContainerEvents(t *testing.T) {
|
|||
eventsCmd := exec.Command(dockerBinary, "events", "--since=0", fmt.Sprintf("--until=%d", time.Now().Unix()))
|
||||
out, exitCode, err := runCommandWithOutput(eventsCmd)
|
||||
if exitCode != 0 || err != nil {
|
||||
t.Fatal("Failed to get events with exit code %d: %s", exitCode, err)
|
||||
t.Fatalf("Failed to get events with exit code %d: %s", exitCode, err)
|
||||
}
|
||||
events := strings.Split(out, "\n")
|
||||
events = events[:len(events)-1]
|
||||
|
@ -119,7 +119,7 @@ func TestCLIGetEventsImageUntagDelete(t *testing.T) {
|
|||
eventsCmd := exec.Command(dockerBinary, "events", "--since=0", fmt.Sprintf("--until=%d", time.Now().Unix()))
|
||||
out, exitCode, err := runCommandWithOutput(eventsCmd)
|
||||
if exitCode != 0 || err != nil {
|
||||
t.Fatal("Failed to get events with exit code %d: %s", exitCode, err)
|
||||
t.Fatalf("Failed to get events with exit code %d: %s", exitCode, err)
|
||||
}
|
||||
events := strings.Split(out, "\n")
|
||||
t.Log(events)
|
||||
|
|
|
@ -102,7 +102,7 @@ func TestContainerOrphaning(t *testing.T) {
|
|||
t.Fatalf("%v: %s", err, out)
|
||||
}
|
||||
if !strings.Contains(out, img1) {
|
||||
t.Fatal("Orphaned container (could not find '%s' in docker images): %s", img1, out)
|
||||
t.Fatalf("Orphaned container (could not find '%s' in docker images): %s", img1, out)
|
||||
}
|
||||
|
||||
deleteAllContainers()
|
||||
|
|
Loading…
Reference in a new issue