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:
2026-03-27 01:42:28 -07:00
parent 078dd39052
commit 296bbc5357
7 changed files with 1156 additions and 221 deletions

View File

@@ -62,6 +62,7 @@ func main() {
root.AddCommand(statusCmd())
root.AddCommand(repoCmd())
root.AddCommand(gcCmd())
root.AddCommand(purgeCmd())
root.AddCommand(policyCmd())
root.AddCommand(auditCmd())
root.AddCommand(snapshotCmd())