mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
fix(meta): fixes for LastUpdated and TaggedTimestamp (#3754)
1. Parse repos without metadata in ParseStorage The timestamp check in ParseStorage was skipping repos that exist in storage but don't have metadata. When GetRepoLastUpdated returns zero time (no metadata), we should always parse the repo to create its metadata. Check if metaLastUpdated is zero before comparing timestamps. If zero, always parse regardless of storageLastUpdated. 2. Change the logic of how LastUpdated is computed in RepoSummary It is not the latest tagged timestamp from the available images or the last updated image created timestamp, based on whichever is the latest. Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
This commit is contained in:
+23
-20
@@ -33,26 +33,29 @@ type PaginatedImagesResult struct {
|
||||
}
|
||||
|
||||
type ImageSummary struct {
|
||||
RepoName string `json:"repoName"`
|
||||
Tag string `json:"tag"`
|
||||
Digest string `json:"digest"`
|
||||
MediaType string `json:"mediaType"`
|
||||
Manifests []ManifestSummary `json:"manifests"`
|
||||
Size string `json:"size"`
|
||||
DownloadCount int `json:"downloadCount"`
|
||||
LastUpdated time.Time `json:"lastUpdated"`
|
||||
Description string `json:"description"`
|
||||
IsSigned bool `json:"isSigned"`
|
||||
Licenses string `json:"licenses"`
|
||||
Labels string `json:"labels"`
|
||||
Title string `json:"title"`
|
||||
Source string `json:"source"`
|
||||
Documentation string `json:"documentation"`
|
||||
Authors string `json:"authors"`
|
||||
Vendor string `json:"vendor"`
|
||||
Vulnerabilities ImageVulnerabilitySummary `json:"vulnerabilities"`
|
||||
Referrers []Referrer `json:"referrers"`
|
||||
SignatureInfo []SignatureSummary `json:"signatureInfo"`
|
||||
RepoName string `json:"repoName"`
|
||||
Tag string `json:"tag"`
|
||||
Digest string `json:"digest"`
|
||||
MediaType string `json:"mediaType"`
|
||||
Manifests []ManifestSummary `json:"manifests"`
|
||||
Size string `json:"size"`
|
||||
DownloadCount int `json:"downloadCount"`
|
||||
LastUpdated time.Time `json:"lastUpdated"`
|
||||
LastPullTimestamp time.Time `json:"lastPullTimestamp"`
|
||||
PushTimestamp time.Time `json:"pushTimestamp"`
|
||||
TaggedTimestamp time.Time `json:"taggedTimestamp"`
|
||||
Description string `json:"description"`
|
||||
IsSigned bool `json:"isSigned"`
|
||||
Licenses string `json:"licenses"`
|
||||
Labels string `json:"labels"`
|
||||
Title string `json:"title"`
|
||||
Source string `json:"source"`
|
||||
Documentation string `json:"documentation"`
|
||||
Authors string `json:"authors"`
|
||||
Vendor string `json:"vendor"`
|
||||
Vulnerabilities ImageVulnerabilitySummary `json:"vulnerabilities"`
|
||||
Referrers []Referrer `json:"referrers"`
|
||||
SignatureInfo []SignatureSummary `json:"signatureInfo"`
|
||||
}
|
||||
|
||||
type ManifestSummary struct {
|
||||
|
||||
Reference in New Issue
Block a user