mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
refactor(storage): refactor storage into a single ImageStore (#1656)
unified both local and s3 ImageStore logic into a single ImageStore added a new driver interface for common file/dirs manipulations to be implemented by different storage types refactor(gc): drop umoci dependency, implemented internal gc added retentionDelay config option that specifies the garbage collect delay for images without tags this will also clean manifests which are part of an index image (multiarch) that no longer exist. fix(dedupe): skip blobs under .sync/ directory if startup dedupe is running while also syncing is running ignore blobs under sync's temporary storage fix(storage): do not allow image indexes modifications when deleting a manifest verify that it is not part of a multiarch image and throw a MethodNotAllowed error to the client if it is. we don't want to modify multiarch images Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
@@ -31,8 +31,8 @@ func TestOnUpdateManifest(t *testing.T) {
|
||||
storeController := storage.StoreController{}
|
||||
log := log.NewLogger("debug", "")
|
||||
metrics := monitoring.NewMetricsServer(false, log)
|
||||
storeController.DefaultStore = local.NewImageStore(rootDir, true, 1*time.Second,
|
||||
true, true, log, metrics, nil, nil,
|
||||
storeController.DefaultStore = local.NewImageStore(rootDir, true, true, 1*time.Second,
|
||||
1*time.Second, true, true, log, metrics, nil, nil,
|
||||
)
|
||||
|
||||
params := boltdb.DBParameters{
|
||||
@@ -72,8 +72,8 @@ func TestOnUpdateManifest(t *testing.T) {
|
||||
storeController := storage.StoreController{}
|
||||
log := log.NewLogger("debug", "")
|
||||
metrics := monitoring.NewMetricsServer(false, log)
|
||||
storeController.DefaultStore = local.NewImageStore(rootDir, true, 1*time.Second,
|
||||
true, true, log, metrics, nil, nil,
|
||||
storeController.DefaultStore = local.NewImageStore(rootDir, true, true, 1*time.Second,
|
||||
1*time.Second, true, true, log, metrics, nil, nil,
|
||||
)
|
||||
|
||||
metaDB := mocks.MetaDBMock{
|
||||
|
||||
@@ -399,7 +399,7 @@ func TestParseStorageDynamoWrapper(t *testing.T) {
|
||||
|
||||
func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
|
||||
Convey("Test with simple case", func() {
|
||||
imageStore := local.NewImageStore(rootDir, false, 0, false, false,
|
||||
imageStore := local.NewImageStore(rootDir, false, false, 0, 0, false, false,
|
||||
log.NewLogger("debug", ""), monitoring.NewMetricsServer(false, log.NewLogger("debug", "")), nil, nil)
|
||||
|
||||
storeController := storage.StoreController{DefaultStore: imageStore}
|
||||
@@ -485,7 +485,7 @@ func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
|
||||
})
|
||||
|
||||
Convey("Accept orphan signatures", func() {
|
||||
imageStore := local.NewImageStore(rootDir, false, 0, false, false,
|
||||
imageStore := local.NewImageStore(rootDir, false, false, 0, 0, false, false,
|
||||
log.NewLogger("debug", ""), monitoring.NewMetricsServer(false, log.NewLogger("debug", "")), nil, nil)
|
||||
|
||||
storeController := storage.StoreController{DefaultStore: imageStore}
|
||||
@@ -542,7 +542,7 @@ func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
|
||||
})
|
||||
|
||||
Convey("Check statistics after load", func() {
|
||||
imageStore := local.NewImageStore(rootDir, false, 0, false, false,
|
||||
imageStore := local.NewImageStore(rootDir, false, false, 0, 0, false, false,
|
||||
log.NewLogger("debug", ""), monitoring.NewMetricsServer(false, log.NewLogger("debug", "")), nil, nil)
|
||||
|
||||
storeController := storage.StoreController{DefaultStore: imageStore}
|
||||
|
||||
Reference in New Issue
Block a user