davahome / ghcr-cleanup

MIT License
5 stars 3 forks source link

Multi-architecture packages are removed inconsistently #3

Open ma-zal opened 2 years ago

ma-zal commented 2 years ago

Introduction

If there are multi-architecture package in repository (like amd64 + arm64 + armv7), then there are created multiple untagged packages, which are linked into single tagged package (linked by Docker manifest). It is because each architecture needs separate untagged own package.

Issue

This action keeps the tagged package (like :stable, :latest), but removes linked untagged packages. Finaly it causes error manifest unknown as result of docker pull command`.

Example:

Multi-architecture package with tag latest created for amd64, arm64, armv7. Finally, repository contains 4 packages:

1) Tagged package latest.

In cleanup script log you can see that "latest" package was skipped because of skip_tags: latest config, but it removed all sha256 untagged packages associated to package with latest tag.

Deleting old versions from user/json-document-storage
Keeping (at least) 0 versions
Will skip images that are older than ${{ input.minimum_days }} days
Skipping images with tags ${{ input.skip_tags }}
Skipping 48492123 (Last Update: 2022-11-02T12:35:26Z) (Tags: 2022.11.02-development-9b4dd9d, 2022.11.02-development, latest): contains a skip tag
Deleting 48492118 (Last Update: 2022-11-02T12:35:25Z) (Untagged)
Successfully deleted
Deleting 48492116 (Last Update: 2022-11-02T12:35:24Z) (Untagged)
Successfully deleted
Deleting 48492115 (Last Update: 2022-11-02T12:35:24Z) (Untagged)
Successfully deleted
Deleted 3 images
rohanmars commented 5 months ago

I implemented new action which focuses on multi arch image cleanup if your interested: https://github.com/dataaxiom/ghcr-cleanup-action