feat(retention): added image retention policies (#1866)

feat(metaDB): add more image statistics info

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu
2023-11-01 18:16:18 +02:00
committed by GitHub
parent a79d79a03a
commit 9074f8483b
71 changed files with 3454 additions and 745 deletions
+7 -4
View File
@@ -64,7 +64,7 @@ type MetaDB interface { //nolint:interfacebloat
SetImageMeta(digest godigest.Digest, imageMeta ImageMeta) error
// SetRepoReference sets the given image data to the repo metadata.
SetRepoReference(repo string, reference string, imageMeta ImageMeta) error
SetRepoReference(ctx context.Context, repo string, reference string, imageMeta ImageMeta) error
// SearchRepos searches for repos given a search string
SearchRepos(ctx context.Context, searchText string) ([]RepoMeta, error)
@@ -116,8 +116,8 @@ type MetaDB interface { //nolint:interfacebloat
// artifact types.
GetReferrersInfo(repo string, referredDigest godigest.Digest, artifactTypes []string) ([]ReferrerInfo, error)
// IncrementImageDownloads adds 1 to the download count of an image
IncrementImageDownloads(repo string, reference string) error
// UpdateStatsOnDownload adds 1 to the download count of an image and sets the timestamp of download
UpdateStatsOnDownload(repo string, reference string) error
// FilterImageMeta returns the image data for the given digests
FilterImageMeta(ctx context.Context, digests []string) (map[string]ImageMeta, error)
@@ -274,7 +274,10 @@ type Descriptor struct {
}
type DescriptorStatistics struct {
DownloadCount int
DownloadCount int
LastPullTimestamp time.Time
PushTimestamp time.Time
PushedBy string
}
type ManifestSignatures map[string][]SignatureInfo