From ebdfeda979d7718f3fc8fc01389c3b0217221614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Sat, 14 Aug 2021 21:34:23 +0200 Subject: [PATCH] Don't read response body twice on putSignaturesToAPIExtension failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit registryHTTPResponseToError expects the response body to be available; don't read it first. Signed-off-by: Miloslav Trmač --- docker/docker_image_dest.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker/docker_image_dest.go b/docker/docker_image_dest.go index 1192064879..7111c56126 100644 --- a/docker/docker_image_dest.go +++ b/docker/docker_image_dest.go @@ -16,7 +16,6 @@ import ( "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/internal/blobinfocache" - "github.com/containers/image/v5/internal/iolimits" "github.com/containers/image/v5/internal/putblobdigest" "github.com/containers/image/v5/internal/uploadreader" "github.com/containers/image/v5/manifest" @@ -649,10 +648,6 @@ sigExists: } defer res.Body.Close() if res.StatusCode != http.StatusCreated { - body, err := iolimits.ReadAtMost(res.Body, iolimits.MaxErrorBodySize) - if err == nil { - logrus.Debugf("Error body %s", string(body)) - } logrus.Debugf("Error uploading signature, status %d, %#v", res.StatusCode, res) return errors.Wrapf(registryHTTPResponseToError(res), "uploading signature to %s in %s", path, d.c.registry) }