mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
Fix file handlers not being closed after calls to ImageStore.GetBlob
This is to fixes hitting the FD limit when reading blobs from the disk in the graphql API Signed-off-by: Andrei Aaron <andaaron@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
74630ed3a0
commit
bd9ad998cd
@@ -30,7 +30,7 @@ type MockedImageStore struct {
|
||||
DeleteBlobUploadFn func(repo string, uuid string) error
|
||||
BlobPathFn func(repo string, digest digest.Digest) string
|
||||
CheckBlobFn func(repo string, digest string) (bool, int64, error)
|
||||
GetBlobFn func(repo string, digest string, mediaType string) (io.Reader, int64, error)
|
||||
GetBlobFn func(repo string, digest string, mediaType string) (io.ReadCloser, int64, error)
|
||||
DeleteBlobFn func(repo string, digest string) error
|
||||
GetIndexContentFn func(repo string) ([]byte, error)
|
||||
GetBlobContentFn func(repo, digest string) ([]byte, error)
|
||||
@@ -230,12 +230,12 @@ func (is MockedImageStore) CheckBlob(repo string, digest string) (bool, int64, e
|
||||
return true, 0, nil
|
||||
}
|
||||
|
||||
func (is MockedImageStore) GetBlob(repo string, digest string, mediaType string) (io.Reader, int64, error) {
|
||||
func (is MockedImageStore) GetBlob(repo string, digest string, mediaType string) (io.ReadCloser, int64, error) {
|
||||
if is.GetBlobFn != nil {
|
||||
return is.GetBlobFn(repo, digest, mediaType)
|
||||
}
|
||||
|
||||
return &io.LimitedReader{}, 0, nil
|
||||
return io.NopCloser(&io.LimitedReader{}), 0, nil
|
||||
}
|
||||
|
||||
func (is MockedImageStore) DeleteBlobUpload(repo string, digest string) error {
|
||||
|
||||
Reference in New Issue
Block a user