1
0
mirror of https://github.com/openshift/image-registry.git synced 2026-02-05 09:45:55 +01:00

pkg/dockerregistry/server: give ctx to filewriter Cancel method

also fix cache provider initialisation
This commit is contained in:
Flavian Missi
2023-05-16 17:10:26 +02:00
parent 6a753a8a04
commit 80fc1891f5
2 changed files with 5 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ func newTestRegistry(
storage.EnableRedirect,
}
if useBlobDescriptorCacheProvider {
cacheProvider := dockercache.BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider())
cacheProvider := dockercache.BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider(-1))
opts = append(opts, storage.BlobDescriptorCacheProvider(cacheProvider))
}

View File

@@ -1,6 +1,8 @@
package wrapped
import (
"context"
storagedriver "github.com/distribution/distribution/v3/registry/storage/driver"
)
@@ -37,9 +39,9 @@ func (w *fileWriter) Close() error {
})
}
func (w *fileWriter) Cancel() error {
func (w *fileWriter) Cancel(ctx context.Context) error {
return w.wrapper("FileWriter.Cancel", func() error {
return w.fileWriter.Cancel()
return w.fileWriter.Cancel(ctx)
})
}