Prototype content-addressed image storage - #426
Merged
Conversation
chruffins
force-pushed
the
hypeship/image-tag-storage
branch
2 times, most recently
from
August 19, 2026 18:52
1e0f14f to
34db1ac
Compare
chruffins
force-pushed
the
hypeship/image-tag-storage
branch
from
August 19, 2026 18:56
34db1ac to
0bc2ca9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7f9c941. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

summary
experimental stacked PR on top of
#425to try the content-addressed image layout discussed in the thread. This PR is intentionally isolated so it can be reviewed, tested, or closed without changing the main image-tag PR.layout
Newly pulled/imported images use:
The implementation also supports the existing layout:
cutover risk
The compatibility readers land in parent PR #425 before this child enables new writes. That makes rollback to #425 safe for existing content-layout images: it can resolve, boot, list, retag, delete, and account for both layouts, while continuing to write newly created legacy images.
The remaining risk is the layout lifecycle itself: reference deletion, shared-content garbage collection, and any code that constructs image paths directly instead of going through the storage helpers. There is no eager migration; legacy images are promoted only when cross-repository tagging needs shared content.
For now, this PR remains an experimental child of
#425: close it without merging to discard the writer experiment, or continue it after the compatibility-reader layer is reviewed.validation
go test ./lib/images -run '^(TestWriteMetadataUsesContentWhenLegacyDirectoryIsEmpty|TestListAllMetadataContentLayout|TestTagImage|TestTagFollowsLastPull)$' -count=1go test ./lib/images ./lib/paths -run '^$'git diff --checkThe full image test suite was not completed locally because the environment does not include the
mkfs.erofsruntime binary required by integration tests.Note
Medium Risk
Changes on-disk layout for new images and shared-content GC/ref counting; mis-precedence or deletion bugs could affect VM disk resolution, though legacy reads and parent compatibility readers mitigate rollout risk.
Overview
Enables content-addressed image storage for new writes by setting
contentLayoutEnabledto true, so metadata and rootfs for new pulls land underimages/content/<digest>/with repository tags as symlinks, while existing per-repository digest trees keep working.Fixes read-path precedence so a complete legacy image (metadata + rootfs under the repository digest dir) wins over a partial or failed content-layout record for the same digest hex—avoiding another repository’s pending/failed content metadata shadowing a ready legacy image.
digestPathandmetadataPathuse the newlegacyImageExistscheck before preferring content paths.Cross-repo clone/tag behavior now routes through the content clone path whenever the layout flag is on (legacy clone only when the flag is off and the source is legacy-only).
Tests cover legacy-vs-content shadowing, metadata writes skipping empty legacy dirs, tag symlink resolution, cross-repo tagging into content store, and refcounted deletion of shared content.
POST /images/{name}/tagis registered underimage:writein route scopes.Reviewed by Cursor Bugbot for commit a170537. Bugbot is set up for automated code reviews on this repo. Configure here.