devopshq / artifactory-cleanup

Extended cleanup tool for JFrog Artifactory
MIT License
126 stars 66 forks source link

Add option KeepLatestNImages #108

Open mikaello opened 1 year ago

mikaello commented 1 year ago

When cleaning images, it is possible to use the option KeepLatestNFiles. But this will look at docker tags, and not docker images.

Example:

If you got 3 images, both tagged with 2 tags each, so in total, you got 6 tags. If you run artifactory-cleanup with KeepLatestNFiles count=2 you may end up in the situation that you only have a single image left (with 2 tags), because each tag is counted as a file.

Proposal:

What I propose is an option, KeepLatestNImages, that only looks at the image digest, and for those images that are older, it will delete all tags. So in the example above you will be left with 2 images (still with 2 tags each, 4 in total).

Rommmmm commented 10 months ago

any news on that?

allburov commented 10 months ago

No, we are looking for help here!