diff --git a/components/engine/client/container_logs.go b/components/engine/client/container_logs.go index 35c297c5fb..562c8b4bcc 100644 --- a/components/engine/client/container_logs.go +++ b/components/engine/client/container_logs.go @@ -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 } diff --git a/components/engine/client/container_logs_test.go b/components/engine/client/container_logs_test.go index 8cb7635120..41849cf576 100644 --- a/components/engine/client/container_logs_test.go +++ b/components/engine/client/container_logs_test.go @@ -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")), diff --git a/components/engine/contrib/download-frozen-image-v2.sh b/components/engine/contrib/download-frozen-image-v2.sh index 22a4b78273..54b592307f 100755 --- a/components/engine/contrib/download-frozen-image-v2.sh +++ b/components/engine/contrib/download-frozen-image-v2.sh @@ -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 }')" diff --git a/components/engine/integration/service/create_test.go b/components/engine/integration/service/create_test.go index a4373721f5..7e78b94992 100644 --- a/components/engine/integration/service/create_test.go +++ b/components/engine/integration/service/create_test.go @@ -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 }