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:
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user