You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: delete orphaned digest directories when last tag is removed (#111)
* fix: delete orphaned digest directories when last tag is removed
Previously, DeleteImage only removed the tag symlink, leaving the digest
directory (containing the erofs rootfs) on disk indefinitely. This caused
orphaned digests to accumulate over time.
Now DeleteImage checks if the digest is orphaned after removing the tag,
and deletes the digest directory if no other tags reference it. This is
eager GC - cleanup happens immediately at delete time.
Made-with: Cursor
* fix: update oapi-codegen/runtime to v1.2.0 for CI compatibility
The CI workflow runs `make oapi-generate` which uses `oapi-codegen@latest`.
The latest generator outputs code using `runtime.StyleParamWithOptions` which
was added in runtime v1.2.0, but go.mod had v1.1.2 pinned.
This caused CI failures on main starting with commit 08958b8.
Made-with: Cursor
* fix: pin oapi-codegen to v2.5.1 to match committed generated code
The CI workflow regenerates oapi.go using `oapi-codegen@latest`. When v2.6.0
was released, it changed struct tag generation (adding omitempty to some fields),
causing type mismatches with code in instances.go that uses inline struct literals.
Pinning to v2.5.1 ensures CI regenerates the same code that's committed.
Made-with: Cursor
* fix: address review feedback - race condition and silent errors
1. Race condition (medium severity): Hold createMu during the orphan
check and delete sequence to prevent a concurrent CreateImage from
creating a tag pointing to the same digest between count and delete.
2. Silent errors (low severity): Actually log errors when countTagsForDigest
or deleteDigest fails, instead of silently swallowing them.
Made-with: Cursor
---------
Co-authored-by: hiroTamada <hiro@kernel.sh>
0 commit comments