Persist OCI manifest content model per image digest - #455
Conversation
8255d11 to
1f79ed8
Compare
-->
✱ stlc build✅ go code · compare
✅ python code · compare
✅ typescript code · compare
Diagnostics: ❗ 0 new / 1 total error, 💡 0 new / 5 total note
Build metadata
This comment is auto-generated by stlc and is kept up to date as you push. |
1d3b38c to
e6fdc4c
Compare
345e8e0 to
07373a3
Compare
07373a3 to
e8971b4
Compare
e8971b4 to
4639430
Compare
4639430 to
273909b
Compare
31c4161 to
c6dcc2c
Compare
c6dcc2c to
cc7944c
Compare
b42b87c to
50bee89
Compare
b992e00 to
76c7b91
Compare
76c7b91 to
5b0a0df
Compare
5b0a0df to
dd879d9
Compare
b2941b0 to
a6e571e
Compare
sjmiller609
left a comment
There was a problem hiding this comment.
1. secondary tag stays stale
starting state
# stable currently resolves to digest A
kernel images create app:stable
# registry updates latest and stable to digest B
docker tag app@sha256:B app:latest
docker tag app@sha256:B app:stable
docker push app:latest
docker push app:stable
# start pulling B through latest
kernel images create app:latestaction
kernel images create app:stableexpected: both tags move to B.
actual: only latest moves; stable remains on A.
2. resource labels are ignored
starting state
kernel images create app:latest --tag team=platform
kernel images wait app:latestaction
kernel images create app:latest --tag team=paymentsexpected: app:latest reports team=payments.
actual: the reused image retains team=platform.
3. readiness returns too early
starting state
# A is ready
kernel images create app@sha256:A
kernel images tag app@sha256:A app:latest
# start B, then a newer C
kernel images create app@sha256:B --as app:latest
kernel images create app@sha256:C --as app:latest
# C subsequently fails; B remains in progressaction
kernel images wait app:latestexpected: wait for B.
actual: immediately succeeds using old ready image A.
4. eager migration potentially risky
If the migration fails for some reason, it's stuck in image not ready until content/A is manually removed.
Consider a no-op migration instead: leave existing images in the legacy layout, use the shared format only for new images, support reads from both layouts, and add lazy migration only when a future feature requires manifest.json.
|
bugs addressed + found 1 more, re-running CI now |
summary
This PR persists an OCI manifest content model for each image digest and updates local image tagging to support shared content, restart recovery, and later layer-level cleanup.
persisted manifest model
Ready images store
images/content/<digest>/manifest.jsoncontaining:os/arch[/variant])rootfs.diff_idsThe model is extracted from the existing OCI layout cache during the pull's metadata phase, without additional registry downloads. Writes use the shared atomic JSON helper.
blobReferences()exposes the config and layer digests for later cleanup.Legacy images remain readable in their existing layout. They are promoted lazily when shared content is needed, and missing legacy models remain valid.
image tagging and recovery
refactoring
The image manager and storage code now split large paths into focused helpers for:
The main hotspots
listAllMetadata,DeleteImage,claimRequestedTags, andcancelPendingTagare no longer high-complexity functions.validation
go test ./lib/images -run '^$'passes.go vet ./lib/imagespasses.git diff --checkpasses.mkfs.erofsis not installed. This is the same pre-existing environment limitation.