Add mcrctl purge command for tag retention
Client-side purge that keeps the last N tags per repository (excluding latest) and deletes older manifests. Uses existing MCR APIs — no new server RPCs needed. Server-side: added updated_at to TagInfo struct and GetRepositoryDetail query so tags can be sorted by recency. Usage: mcrctl purge --keep 3 --dry-run --gc Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,8 +78,9 @@ func (s *registryService) GetRepository(_ context.Context, req *pb.GetRepository
|
||||
}
|
||||
for _, t := range detail.Tags {
|
||||
resp.Tags = append(resp.Tags, &pb.TagInfo{
|
||||
Name: t.Name,
|
||||
Digest: t.Digest,
|
||||
Name: t.Name,
|
||||
Digest: t.Digest,
|
||||
UpdatedAt: t.UpdatedAt,
|
||||
})
|
||||
}
|
||||
for _, m := range detail.Manifests {
|
||||
|
||||
Reference in New Issue
Block a user