From c7fbe1c2bae7b374a34260f00dc7f286cc4e36cf Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 20 Mar 2025 20:16:12 +0100 Subject: [PATCH] integration-cli: fix duplicate close of body request.ReadBody already closes the body; time="2025-03-20T19:08:25Z" level=error msg="subsequent attempt to close ReadCloserWrapper" Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_api_build_test.go | 1 - integration-cli/docker_api_test.go | 1 - 2 files changed, 2 deletions(-) diff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go index e28e634dd6..a163e5ab08 100644 --- a/integration-cli/docker_api_build_test.go +++ b/integration-cli/docker_api_build_test.go @@ -122,7 +122,6 @@ RUN echo 'right' assert.NilError(c, err) assert.Equal(c, res.StatusCode, http.StatusOK) - defer body.Close() content, err := request.ReadBody(body) assert.NilError(c, err) diff --git a/integration-cli/docker_api_test.go b/integration-cli/docker_api_test.go index f00f02fad9..f4ecbce09c 100644 --- a/integration-cli/docker_api_test.go +++ b/integration-cli/docker_api_test.go @@ -59,7 +59,6 @@ func (s *DockerAPISuite) TestAPIClientVersionOldNotSupported(c *testing.T) { resp, body, err := request.Get(testutil.GetContext(c), "/v"+version+"/version") assert.NilError(c, err) - defer body.Close() assert.Equal(c, resp.StatusCode, http.StatusBadRequest) expected := fmt.Sprintf("client version %s is too old. Minimum supported API version is %s, please upgrade your client to a newer version", version, testEnv.DaemonVersion.MinAPIVersion) b, err := request.ReadBody(body)