Merge component 'engine' from git@github.com:moby/moby master
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
@ -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")),
|
||||
|
||||
@ -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 }')"
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user