From ff1a5056d799217675fdde5c08fa0ac34894fccc Mon Sep 17 00:00:00 2001 From: guangwu Date: Tue, 9 Apr 2024 14:27:46 +0800 Subject: [PATCH] fix: close blob io ReadCloser (#20225) Signed-off-by: guoguangwu Co-authored-by: Wang Yan --- src/controller/artifact/annotation/v1alpha1.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controller/artifact/annotation/v1alpha1.go b/src/controller/artifact/annotation/v1alpha1.go index 15c464ab2..6ca4605e1 100644 --- a/src/controller/artifact/annotation/v1alpha1.go +++ b/src/controller/artifact/annotation/v1alpha1.go @@ -92,6 +92,7 @@ func parseV1alpha1Icon(artifact *artifact.Artifact, manifest *v1.Manifest, reg r if err != nil { return err } + defer icon.Close() // check the size of the size <= 1MB data, err := io.ReadAll(io.LimitReader(icon, 1<<20)) if err != nil {