Merge pull request #8977 from LK4D4/vet_fixes

Fix vet errors
Upstream-commit: 546884fd20b0a3e7692f1edf5415b48df65a2e7f
Component: engine
This commit is contained in:
Michael Crosby
2014-11-06 11:59:05 -08:00
9 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ func main() {
if err := cli.Cmd(flag.Args()...); err != nil {
if sterr, ok := err.(*utils.StatusError); ok {
if sterr.Status != "" {
log.Println("%s", sterr.Status)
log.Println(sterr.Status)
}
os.Exit(sterr.StatusCode)
}
@@ -218,7 +218,7 @@ func TestBuildEnvironmentReplacementEnv(t *testing.T) {
if parts[0] == "bar" {
found = true
if parts[1] != "foo" {
t.Fatal("Could not find replaced var for env `bar`: got %q instead of `foo`", parts[1])
t.Fatalf("Could not find replaced var for env `bar`: got %q instead of `foo`", parts[1])
}
}
}
@@ -1224,7 +1224,7 @@ func TestBuildCopyDisallowRemote(t *testing.T) {
COPY https://index.docker.io/robots.txt /`,
true)
if err == nil || !strings.Contains(out, "Source can't be a URL for COPY") {
t.Fatal("Error should be about disallowed remote source, got err: %s, out: %q", err, out)
t.Fatalf("Error should be about disallowed remote source, got err: %s, out: %q", err, out)
}
logDone("build - copy - disallow copy from remote")
}
@@ -1374,7 +1374,7 @@ func TestBuildForceRm(t *testing.T) {
buildCmd := exec.Command(dockerBinary, "build", "-t", name, "--force-rm", ".")
buildCmd.Dir = ctx.Dir
if out, _, err := runCommandWithOutput(buildCmd); err == nil {
t.Fatal("failed to build the image: %s, %v", out, err)
t.Fatalf("failed to build the image: %s, %v", out, err)
}
containerCountAfter, err := getContainerCount()
@@ -3181,7 +3181,7 @@ func TestBuildEntrypointInheritance(t *testing.T) {
status, _ = runCommand(exec.Command(dockerBinary, "run", "child"))
if status != 5 {
t.Fatal("expected exit code 5 but received %d", status)
t.Fatalf("expected exit code 5 but received %d", status)
}
logDone("build - clear entrypoint")
@@ -47,7 +47,7 @@ RUN echo "Z"`,
out, exitCode, err := runCommandWithOutput(exec.Command(dockerBinary, "history", "testbuildhistory"))
if err != nil || exitCode != 0 {
t.Fatal("failed to get image history: %s, %v", out, err)
t.Fatalf("failed to get image history: %s, %v", out, err)
}
actualValues := strings.Split(out, "\n")[1:27]
@@ -11,7 +11,7 @@ func TestInfoEnsureSucceeds(t *testing.T) {
versionCmd := exec.Command(dockerBinary, "info")
out, exitCode, err := runCommandWithOutput(versionCmd)
if err != nil || exitCode != 0 {
t.Fatal("failed to execute docker info: %s, %v", out, err)
t.Fatalf("failed to execute docker info: %s, %v", out, err)
}
stringsToCheck := []string{"Containers:", "Execution Driver:", "Kernel Version:"}
@@ -11,7 +11,7 @@ import (
func TestPullImageFromCentralRegistry(t *testing.T) {
pullCmd := exec.Command(dockerBinary, "pull", "scratch")
if out, _, err := runCommandWithOutput(pullCmd); err != nil {
t.Fatal("pulling the scratch image from the registry has failed: %s, %v", out, err)
t.Fatalf("pulling the scratch image from the registry has failed: %s, %v", out, err)
}
logDone("pull - pull scratch")
}
@@ -20,7 +20,7 @@ func TestPullImageFromCentralRegistry(t *testing.T) {
func TestPullNonExistingImage(t *testing.T) {
pullCmd := exec.Command(dockerBinary, "pull", "fooblahblah1234")
if out, _, err := runCommandWithOutput(pullCmd); err == nil {
t.Fatal("expected non-zero exit status when pulling non-existing image: %s", out)
t.Fatalf("expected non-zero exit status when pulling non-existing image: %s", out)
}
logDone("pull - pull fooblahblah1234 (non-existing image)")
}
@@ -16,12 +16,12 @@ func TestPushBusyboxImage(t *testing.T) {
repoName := fmt.Sprintf("%v/busybox", privateRegistryURL)
tagCmd := exec.Command(dockerBinary, "tag", "busybox", repoName)
if out, _, err := runCommandWithOutput(tagCmd); err != nil {
t.Fatal("image tagging failed: %s, %v", out, err)
t.Fatalf("image tagging failed: %s, %v", out, err)
}
pushCmd := exec.Command(dockerBinary, "push", repoName)
if out, _, err := runCommandWithOutput(pushCmd); err != nil {
t.Fatal("pushing the image to the private registry has failed: %s, %v", out, err)
t.Fatalf("pushing the image to the private registry has failed: %s, %v", out, err)
}
deleteImages(repoName)
@@ -35,7 +35,7 @@ func TestPushUnprefixedRepo(t *testing.T) {
t.Skip()
pushCmd := exec.Command(dockerBinary, "push", "busybox")
if out, _, err := runCommandWithOutput(pushCmd); err == nil {
t.Fatal("pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
t.Fatalf("pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
}
logDone("push - push unprefixed busybox repo --> must fail")
}
@@ -114,7 +114,7 @@ func TestRmInvalidContainer(t *testing.T) {
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "rm", "unknown")); err == nil {
t.Fatal("Expected error on rm unknown container, got none")
} else if !strings.Contains(out, "failed to remove one or more containers") {
t.Fatal("Expected output to contain 'failed to remove one or more containers', got %q", out)
t.Fatalf("Expected output to contain 'failed to remove one or more containers', got %q", out)
}
logDone("rm - delete unknown container")
@@ -11,7 +11,7 @@ func TestSearchOnCentralRegistry(t *testing.T) {
searchCmd := exec.Command(dockerBinary, "search", "busybox")
out, exitCode, err := runCommandWithOutput(searchCmd)
if err != nil || exitCode != 0 {
t.Fatal("failed to search on the central registry: %s, %v", out, err)
t.Fatalf("failed to search on the central registry: %s, %v", out, err)
}
if !strings.Contains(out, "Busybox base image.") {
@@ -11,7 +11,7 @@ func TestVersionEnsureSucceeds(t *testing.T) {
versionCmd := exec.Command(dockerBinary, "version")
out, _, err := runCommandWithOutput(versionCmd)
if err != nil {
t.Fatal("failed to execute docker version: %s, %v", out, err)
t.Fatalf("failed to execute docker version: %s, %v", out, err)
}
stringsToCheck := []string{