Skip to content

Commit

Permalink
fix: close blob io ReadCloser (#20225)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
Co-authored-by: Wang Yan <[email protected]>
  • Loading branch information
testwill and wy65701436 authored Apr 9, 2024
1 parent 96ba34a commit ff1a505
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/controller/artifact/annotation/v1alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ff1a505

Please sign in to comment.