forgejo/services/packages/container
Earl Warren 0a5fd7fdb8
fix: referenced sha256:* container images may be deleted
The inventory of the sha256:* images and the manifest index that
reference them is incomplete because it does not take into account any
image older than the expiration limit. As a result some sha256:* will
be considered orphaned although they are referenced from a manifest
index that was created more recently than the expiration limit.

There must not be any filtering based on the creation time when
building the inventory. The expiration limit must only be taken into
account when deleting orphaned images: those that are more recent than
the expiration limit must not be deleted.

This limit is specially important because it protects against a race
between a cleanup task and an ongoing mirroring task. A mirroring
task (such as skopeo sync) will first upload sha256:* images and then
create the corresponding manifest index. If a cleanup races against
it, the sha256:* images that are not yet referenced will be deleted
without skopeo noticing and the published index manifest that happens
at a later time will contain references to non-existent images.
2024-09-30 16:56:21 +02:00
..
blob_uploader.go Introduce path Clean/Join helper functions (#23495) 2023-03-21 16:02:49 -04:00
cleanup.go cron task to cleanup dangling container images with version sha256:* 2024-08-22 09:10:15 +02:00
cleanup_sha256.go fix: referenced sha256:* container images may be deleted 2024-09-30 16:56:21 +02:00
common.go Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00