Don't write pull output to stdout on container creating

Fixes #8632

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
Alexandr Morozov
2014-10-17 11:08:53 -07:00
parent 6ac9768eaf
commit ad136e1ae3
2 changed files with 23 additions and 2 deletions
+16
View File
@@ -2,6 +2,7 @@ package main
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"net"
@@ -2380,3 +2381,18 @@ func TestRunVolumesNotRecreatedOnStart(t *testing.T) {
logDone("run - volumes not recreated on start")
}
func TestRunNoOutputFromPullInStdout(t *testing.T) {
defer deleteAllContainers()
// just run with unknown image
cmd := exec.Command(dockerBinary, "run", "asdfsg")
stdout := bytes.NewBuffer(nil)
cmd.Stdout = stdout
if err := cmd.Run(); err == nil {
t.Fatal("Run with unknown image should fail")
}
if stdout.Len() != 0 {
t.Fatalf("Stdout contains output from pull: %s", stdout)
}
logDone("run - no output from pull in stdout")
}