Don't write pull output to stdout on container creating
Fixes #8632 Signed-off-by: Alexandr Morozov <lk4d4@docker.com> Upstream-commit: ff325bcb2feb501c2287ecb305644b003784f726 Component: engine
This commit is contained in:
committed by
Tibor Vass
parent
7634be83d9
commit
540f32c0f8
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
@ -2374,3 +2375,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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user