2021-07-16 22:53:05 -05:00
|
|
|
package s3
|
|
|
|
|
|
|
|
import (
|
2021-12-13 14:23:31 -05:00
|
|
|
// Add s3 support.
|
2024-08-02 16:23:53 -05:00
|
|
|
"github.com/distribution/distribution/v3/registry/storage/driver"
|
2021-12-13 14:23:31 -05:00
|
|
|
// Load s3 driver.
|
2024-08-02 16:23:53 -05:00
|
|
|
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"
|
2022-10-20 11:39:20 -05:00
|
|
|
|
2024-01-31 23:34:07 -05:00
|
|
|
"zotregistry.dev/zot/pkg/extensions/monitoring"
|
|
|
|
zlog "zotregistry.dev/zot/pkg/log"
|
|
|
|
"zotregistry.dev/zot/pkg/storage/cache"
|
|
|
|
common "zotregistry.dev/zot/pkg/storage/common"
|
|
|
|
"zotregistry.dev/zot/pkg/storage/imagestore"
|
|
|
|
storageTypes "zotregistry.dev/zot/pkg/storage/types"
|
2021-07-16 22:53:05 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// NewObjectStorage returns a new image store backed by cloud storages.
|
|
|
|
// see https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers
|
2022-11-02 17:53:08 -05:00
|
|
|
// Use the last argument to properly set a cache database, or it will default to boltDB local storage.
|
2023-09-22 13:51:20 -05:00
|
|
|
func NewImageStore(rootDir string, cacheDir string, dedupe, commit bool, log zlog.Logger,
|
|
|
|
metrics monitoring.MetricServer, linter common.Lint, store driver.StorageDriver, cacheDriver cache.Cache,
|
2023-05-26 13:08:19 -05:00
|
|
|
) storageTypes.ImageStore {
|
2023-09-01 12:54:39 -05:00
|
|
|
return imagestore.NewImageStore(
|
|
|
|
rootDir,
|
|
|
|
cacheDir,
|
|
|
|
dedupe,
|
|
|
|
commit,
|
|
|
|
log,
|
|
|
|
metrics,
|
|
|
|
linter,
|
|
|
|
New(store),
|
|
|
|
cacheDriver,
|
|
|
|
)
|
2023-04-07 11:49:24 -05:00
|
|
|
}
|