mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 21:02:07 +00:00
[PR #44] [MERGED] feat(pve): reap orphaned image tarballs from pve-templates/ #45
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/44
Author: @JBailes
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @JBailes
Base:
main← Head:fix/reap-orphan-tarballs📝 Commits (1)
2fd3686feat(pve): reap orphaned image tarballs; log tarball-removal errors📊 Changes
3 files changed (+145 additions, -3 deletions)
View changed files
📝
internal/lxc/manager.go(+9 -2)📝
internal/lxc/pve_tarball.go(+55 -0)📝
internal/lxc/pve_tarball_test.go(+81 -1)📄 Description
Closes the symmetric gap to the leaked-CT reaper (#43).
docker rmialready deletes a tarball-backed image's.tar.gzand the OCI blobs are cleaned at pull time, so a normal pull→rmi cycle leaves nothing behind. But if an image record is ever lost (crash, or a scheme migration)RemoveImagenever runs for it and the tarball lingers forever underpve-templates/.Changes
reapOrphanTarballs()added to the GC cycle: deletes anypve-templates/*.tar.gznot referenced by an image record'sTemplateTarball. Guarded exactly likereapOrphanCTs—pullOCIwrites the tarball beforeAddImage, so the same grace window (orphanCTGrace) skips a pull in flight, plus a store re-check immediately before each delete.RemoveImageno longer ignores theos.Removeerror — logs it (other than not-exist) so a left-behind tarball is visible; the reaper is the backstop.Tests
TestReapOrphanTarballs: referenced tarball survives, aged orphan reaped, in-grace (mid-pull) tarball survives.TestReapOrphanTarballsSkippedWhenNotPVE: non-PVE mode never touches tarballs.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.