SUSE / Portus

Authorization service and frontend for Docker registry (v2)
http://port.us.org/
Apache License 2.0
3k stars 471 forks source link

Garbage Collector deletes too much! #2238

Closed xfh closed 4 years ago

xfh commented 4 years ago

Description

We activated the garbage collector option with the 2.4.2 version of Portus with the following configuration:

delete:
  enabled: true
  contributors: false
  garbage_collector:
    enabled: false
    older_than: 30
    tag: ".*-SNAPSHOT$"

Based on the tag regex, we assumed that only SNAPSHOT tags will be removed.

Unfortunately, when there are multiple tags, e.g. latest and 1-SNAPSHOT point to the same Image (same digest), both tags get deleted, because deletion is based on deleting the digest.

We expected, that in this case the image would still remain, but only have the latest tag. That would be similar behaviour to docker rmi REPOSITORY:TAG, which just untags, when another tag exists.

stale[bot] commented 4 years ago

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.