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
+8 -2
View File
@@ -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,
}
}
+4 -1
View File
@@ -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,
}
}