From 9ac2e963f9a34ce5101637ff85c7bba4b1a9d8f8 Mon Sep 17 00:00:00 2001 From: Geoff Franks Date: Mon, 11 Nov 2024 18:11:01 +0000 Subject: [PATCH] Reduce memory usage when calculating release shasum --- pkg/cargo/bosh_release.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cargo/bosh_release.go b/pkg/cargo/bosh_release.go index bd44be3c..9befde7f 100644 --- a/pkg/cargo/bosh_release.go +++ b/pkg/cargo/bosh_release.go @@ -155,7 +155,7 @@ func ReadBOSHReleaseTarball(tarballPath string, r io.Reader) (BOSHReleaseTarball if err != nil { return BOSHReleaseTarball{}, err } - _, err = io.ReadAll(r) + _, err = io.CopyBuffer(io.Discard, r, make([]byte, 1024 * 64)) return BOSHReleaseTarball{ Manifest: m, SHA1: hex.EncodeToString(sum.Sum(nil)),