mirror of
https://github.com/docker/docs.git
synced 2026-03-29 15:28:51 +07:00
Merge pull request #12649 from jlhawn/fix_pull_err_explosion
Correctly format API error on image pull
This commit is contained in:
@@ -98,8 +98,13 @@ func (s *DockerSuite) TestPullImageFromCentralRegistry(c *check.C) {
|
||||
|
||||
// pulling a non-existing image from the central registry should return a non-zero exit code
|
||||
func (s *DockerSuite) TestPullNonExistingImage(c *check.C) {
|
||||
pullCmd := exec.Command(dockerBinary, "pull", "fooblahblah1234")
|
||||
if out, _, err := runCommandWithOutput(pullCmd); err == nil {
|
||||
testRequires(c, Network)
|
||||
|
||||
name := "sadfsadfasdf"
|
||||
pullCmd := exec.Command(dockerBinary, "pull", name)
|
||||
out, _, err := runCommandWithOutput(pullCmd)
|
||||
|
||||
if err == nil || !strings.Contains(out, fmt.Sprintf("Error: image library/%s:latest not found", name)) {
|
||||
c.Fatalf("expected non-zero exit status when pulling non-existing image: %s", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user