Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31810

Blobs are not removed from Docker repo upon cleanup when they are referenced by manifests in another repository (with a different blob store)

    Details

      Description

      Given two Docker hosted repositories (docker_repo_a and docker_repo_b) using different blob stores (blobstore_a and blobstore_b respectively), a "Docker - Delete unused manifests and images" task won't delete unused blobs from one repo if they are referenced in the manifests from the other, even though the blob stores are separate.

      To reproduce this issue:

      1. create the repositories as described above (you can use the following groovy script: link)
      2. upload the test images (e.g. like here)
      3. configure a "Docker - Delete unused manifests and images" task for both repos or just the docker_repo_a
      4. remove the manifests from docker_repo_a (delete the v2/alpine folder in the browse view)
      5. run the task configured above - the blobs are not removed from the repository. I would expect them to be deleted, as they are not referenced anymore within the repo and blob store scope.

      If the v2/alpine folder is removed from docker_repo_b and the task is retriggered, the blobs are removed (it looks like the check for manifests referencing the blobs in the garbage collect task is ignoring the fact that the blob stores are different).

      For some setups this may make the cleanup tasks unable to reclaim the storage space used by obsolete artifacts in the docker repo.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jan.rotter Jan Rotter
            Last Updated By:
            Piotr Filip Piotr Filip
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title