mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 21:02:07 +00:00
[PR #45] [MERGED] fix(pve): ImageReady recognizes tarball images (fixes duplicate image records) #47
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#47
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/45
Author: @JBailes
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @JBailes
Base:
main← Head:fix/imageready-tarball📝 Commits (1)
85b7c22fix(pve): recognize tarball-backed images in ImageReady; fixes duplicate records📊 Changes
2 files changed (+38 additions, -0 deletions)
View changed files
📝
internal/lxc/manager.go(+9 -0)📝
internal/lxc/pve_tarball_test.go(+29 -0)📄 Description
Problem
docker run busyboxafterdocker pull busyboxcreated a second image recordbusybox(with its own tarball) alongside the canonicaldocker.io/library/busybox:latest. This is why the Proxmox host accumulated duplicatepve-templates/*.tar.gzand whydocker rmi <shortname>behaved confusingly.Root cause
ImageReadyonly recognized the legacy schemes: aTemplateVMIDconf, or anlxcPath/<TemplateName>/configdir. A current tarball-backed image has neither, soImageReadyreturnedfalsefor an image that was actually fully pulled. The container-create path (containers.go:94) treats "present but not ready" as a miss and re-pulls viaPullImageWith(req.Image, …)— under the raw request ref — registering a duplicate record.Fix
Teach
ImageReadyto treat a tarball-backed image as ready iff itsTemplateTarballexists (checked before the legacy probes). The create path then finds the already-pulled image via the store's fuzzy ref match and skips the spurious re-pull, so no duplicate is created.Tests
TestImageReadyTarball: tarball present → ready (even with no legacy template dir); tarball missing → not ready; nil → not ready.Follow-up to #43 (leaked-CT reaper) and #44 (orphan-tarball reaper).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.