mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
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:
@@ -297,7 +297,10 @@ func GetStatisticsMap(stats map[string]*proto_go.DescriptorStatistics) map[strin
|
||||
|
||||
for digest, stat := range stats {
|
||||
results[digest] = mTypes.DescriptorStatistics{
|
||||
DownloadCount: int(stat.DownloadCount),
|
||||
DownloadCount: int(stat.DownloadCount),
|
||||
LastPullTimestamp: stat.LastPullTimestamp.AsTime(),
|
||||
PushTimestamp: stat.PushTimestamp.AsTime(),
|
||||
PushedBy: stat.PushedBy,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +313,10 @@ func GetImageStatistics(stats *proto_go.DescriptorStatistics) mTypes.DescriptorS
|
||||
}
|
||||
|
||||
return mTypes.DescriptorStatistics{
|
||||
DownloadCount: int(stats.DownloadCount),
|
||||
DownloadCount: int(stats.DownloadCount),
|
||||
LastPullTimestamp: stats.LastPullTimestamp.AsTime(),
|
||||
PushTimestamp: stats.PushTimestamp.AsTime(),
|
||||
PushedBy: stats.PushedBy,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,10 @@ func GetProtoStatistics(stats map[string]mTypes.DescriptorStatistics) map[string
|
||||
|
||||
for digest, stat := range stats {
|
||||
results[digest] = &proto_go.DescriptorStatistics{
|
||||
DownloadCount: int32(stat.DownloadCount),
|
||||
DownloadCount: int32(stat.DownloadCount),
|
||||
LastPullTimestamp: timestamppb.New(stat.LastPullTimestamp),
|
||||
PushTimestamp: timestamppb.New(stat.PushTimestamp),
|
||||
PushedBy: stat.PushedBy,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user