2022-09-30 12:35:16 -05:00
|
|
|
package local
|
2021-09-30 08:27:13 -05:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2021-12-03 22:50:58 -05:00
|
|
|
"zotregistry.io/zot/pkg/extensions/monitoring"
|
|
|
|
zlog "zotregistry.io/zot/pkg/log"
|
2022-11-02 17:53:08 -05:00
|
|
|
"zotregistry.io/zot/pkg/storage/cache"
|
2023-05-26 13:08:19 -05:00
|
|
|
common "zotregistry.io/zot/pkg/storage/common"
|
2023-09-01 12:54:39 -05:00
|
|
|
"zotregistry.io/zot/pkg/storage/imagestore"
|
2023-05-26 13:08:19 -05:00
|
|
|
storageTypes "zotregistry.io/zot/pkg/storage/types"
|
2023-08-19 00:52:03 -05:00
|
|
|
)
|
|
|
|
|
2021-09-30 08:27:13 -05:00
|
|
|
// NewImageStore returns a new image store backed by a file storage.
|
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-01 12:54:39 -05:00
|
|
|
func NewImageStore(rootDir string, gc bool, gcReferrers bool, gcDelay time.Duration,
|
|
|
|
untaggedImageRetentionDelay time.Duration, dedupe, commit bool,
|
2023-05-26 13:08:19 -05:00
|
|
|
log zlog.Logger, metrics monitoring.MetricServer, linter common.Lint, cacheDriver cache.Cache,
|
|
|
|
) storageTypes.ImageStore {
|
2023-09-01 12:54:39 -05:00
|
|
|
return imagestore.NewImageStore(
|
|
|
|
rootDir,
|
|
|
|
rootDir,
|
|
|
|
gc,
|
|
|
|
gcReferrers,
|
|
|
|
gcDelay,
|
|
|
|
untaggedImageRetentionDelay,
|
|
|
|
dedupe,
|
|
|
|
commit,
|
|
|
|
log,
|
|
|
|
metrics,
|
|
|
|
linter,
|
|
|
|
New(commit),
|
|
|
|
cacheDriver,
|
|
|
|
)
|
2023-04-07 11:49:24 -05:00
|
|
|
}
|