From 33c49e5f81c048296eb5bc363a4281e10e0edc8b Mon Sep 17 00:00:00 2001 From: mikemikimike <13286568797@163.com> Date: Sat, 15 Aug 2026 22:33:32 +0800 Subject: [PATCH] Fix OCI prune cleanup of broken tag symlinks --- Sources/tart/Commands/Prune.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/tart/Commands/Prune.swift b/Sources/tart/Commands/Prune.swift index 4ff12ff..3aa57d7 100644 --- a/Sources/tart/Commands/Prune.swift +++ b/Sources/tart/Commands/Prune.swift @@ -72,6 +72,12 @@ struct Prune: AsyncParsableCommand { if let spaceBudget = spaceBudget { try Prune.pruneSpaceBudget(prunableStorages: prunableStorages, spaceBudgetBytes: UInt64(spaceBudget) * 1024 * 1024 * 1024) } + + // Pruning digest-addressed OCI images can leave their tag symlinks broken. + // Run garbage collection after deletion so it can remove those links. + if entries == "caches" && (olderThan != nil || spaceBudget != nil) { + try VMStorageOCI().gc() + } } static func pruneOlderThan(prunableStorages: [PrunableStorage], olderThanDate: Date) throws {