Skip to content

Commit

Permalink
Merge pull request moby#8977 from LK4D4/vet_fixes
Browse files Browse the repository at this point in the history
Fix vet errors
  • Loading branch information
crosbymichael committed Nov 6, 2014
2 parents 6a6be5b + 18d9f19 commit 546884f
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
8 changes: 4 additions & 4 deletions integration-cli/docker_cli_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}
}
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"}
Expand Down
4 changes: 2 additions & 2 deletions integration-cli/docker_cli_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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)")
}
6 changes: 3 additions & 3 deletions integration-cli/docker_cli_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
}
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.") {
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 546884f

Please sign in to comment.