diff --git a/Sources/tart/Commands/Pull.swift b/Sources/tart/Commands/Pull.swift index d14bc9b..02c5e29 100644 --- a/Sources/tart/Commands/Pull.swift +++ b/Sources/tart/Commands/Pull.swift @@ -47,8 +47,5 @@ struct Pull: AsyncParsableCommand { defaultLogger.appendNewLine("pulling \(remoteName)...") try await VMStorageOCI().pull(remoteName, registry: registry, concurrency: concurrency, deduplicate: deduplicate) - - // to explicitly set the image as being accessed so it won't get pruned immediately - _ = try VMStorageOCI().open(remoteName) } } diff --git a/Sources/tart/VMStorageOCI.swift b/Sources/tart/VMStorageOCI.swift index 71009fa..86896d4 100644 --- a/Sources/tart/VMStorageOCI.swift +++ b/Sources/tart/VMStorageOCI.swift @@ -239,6 +239,9 @@ class VMStorageOCI: PrunableStorage { // are excluded from garbage collection VMDirectory(baseURL: vmURL(name)).markExplicitlyPulled() } + + // to explicitly set the image as being accessed so it won't get pruned immediately + _ = try VMStorageOCI().open(name) } func linked(from: RemoteName, to: RemoteName) -> Bool {