Merge component 'engine' from git@github.com:moby/moby master

This commit is contained in:
GordonTheTurtle
2018-01-13 17:03:55 +00:00
4 changed files with 14 additions and 3 deletions

View File

@ -74,7 +74,7 @@ func (cli *Client) ContainerLogs(ctx context.Context, container string, options
resp, err := cli.get(ctx, "/containers/"+container+"/logs", query, nil)
if err != nil {
return nil, err
return nil, wrapResponseError(err, resp, "container", container)
}
return resp.body, nil
}

View File

@ -18,6 +18,16 @@ import (
"golang.org/x/net/context"
)
func TestContainerLogsNotFoundError(t *testing.T) {
client := &Client{
client: newMockClient(errorMock(http.StatusNotFound, "Not found")),
}
_, err := client.ContainerLogs(context.Background(), "container_id", types.ContainerLogsOptions{})
if !IsErrNotFound(err) {
t.Fatalf("expected a not found error, got %v", err)
}
}
func TestContainerLogsError(t *testing.T) {
client := &Client{
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),

View File

@ -63,7 +63,7 @@ fetch_blob() {
-D-
)"
curlHeaders="$(echo "$curlHeaders" | tr -d '\r')"
if echo "$curlHeaders" | grep -qE "^HTTP/[0-9].[0-9] 3"; then
if grep -qE "^HTTP/[0-9].[0-9] 3" <<<"$curlHeaders"; then
rm -f "$targetFile"
local blobRedirect="$(echo "$curlHeaders" | awk -F ': ' 'tolower($1) == "location" { print $2; exit }')"

View File

@ -43,7 +43,8 @@ func TestCreateServiceMultipleTimes(t *testing.T) {
require.NoError(t, err)
pollSettings := func(config *poll.Settings) {
if runtime.GOARCH == "arm" {
// It takes about ~25s to finish the multi services creation in this case per the pratical observation on arm64/arm platform
if runtime.GOARCH == "arm64" || runtime.GOARCH == "arm" {
config.Timeout = 30 * time.Second
config.Delay = 100 * time.Millisecond
}