mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix: excessive memory usage (#2164)
instead of reading entire files before calculating their digests stream them by using their Reader method. Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
@@ -59,6 +59,7 @@ type MockedImageStore struct {
|
||||
PutIndexContentFn func(repo string, index ispec.Index) error
|
||||
PopulateStorageMetricsFn func(interval time.Duration, sch *scheduler.Scheduler)
|
||||
StatIndexFn func(repo string) (bool, int64, time.Time, error)
|
||||
VerifyBlobDigestValueFn func(repo string, digest godigest.Digest) error
|
||||
}
|
||||
|
||||
func (is MockedImageStore) StatIndex(repo string) (bool, int64, time.Time, error) {
|
||||
@@ -425,3 +426,11 @@ func (is MockedImageStore) PopulateStorageMetrics(interval time.Duration, sch *s
|
||||
is.PopulateStorageMetricsFn(interval, sch)
|
||||
}
|
||||
}
|
||||
|
||||
func (is MockedImageStore) VerifyBlobDigestValue(repo string, digest godigest.Digest) error {
|
||||
if is.VerifyBlobDigestValueFn != nil {
|
||||
return is.VerifyBlobDigestValueFn(repo, digest)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user