mirror of
https://github.com/goharbor/harbor
synced 2025-04-18 18:56:19 +00:00
fix: close blob io ReadCloser (#20225)
Signed-off-by: guoguangwu <guoguangwug@gmail.com> Co-authored-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
parent
96ba34a93c
commit
ff1a5056d7
|
@ -92,6 +92,7 @@ func parseV1alpha1Icon(artifact *artifact.Artifact, manifest *v1.Manifest, reg r
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer icon.Close()
|
||||||
// check the size of the size <= 1MB
|
// check the size of the size <= 1MB
|
||||||
data, err := io.ReadAll(io.LimitReader(icon, 1<<20))
|
data, err := io.ReadAll(io.LimitReader(icon, 1<<20))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user