Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26259

Overridden docker tags cleanup might delete the wrong tag

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.24.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Location:
      External

      Description

      Problem Description:

      The overridden docker tags cleanup flow might delete the wrong or most recently deployed tag.

      When a docker tag (say my-image:latest) is overridden and the dockerTagRetention value that's configured for a docker repository (say docker-local) is exceeded, the cleanup job collects all candidates for cleanup by running an AQL query that filters by docker.manifest=<overridden tag> (=latest) property and value, and sorts the result according to the modified time (ascending).

      The query does not filter by the original overridden image repository (docker-local), thus, the result set that's returned might contain tags from other repositories as well. The result set is transformed to an ordered list of DockerTags, that are constructed using the original overridden image repository key (docker-local). So, In case an old tag was collected from another repository (docker-local-old/my-image:latest) and it indeed the oldest of all tags - it will be transformed to a DockerTag according a wrong repository key (docker-local/my-image:latest)

      This will result in the deletion of the wrong docker tag (docker-local/my-image:latest)

      Expected Behaviour:

      The cleanup job should delete the oldest docker tag, out of all the tags the reside under the same repository as the overridden image.

      Steps to Reproduce:

      Create a local docker-new repository, and configure: dockertagRetention=2
      Create a local docker-old repository
      Deploy docker-old/busybox:latest
      Deploy docker-new/busybox:latest
      Deploy docker-new/busybox:latest (override previous tag)
      The tag that will be deleted is docker-new/busybox:latest

      Suggested Solution:

      The AQL query that collects cleanup candidates in:
      DockerV2TagCleanupServiceImpl#getDockerRepoTags
      should filter by the specific repository key of the overridden image. It looks like this was the case until some more recent changes were introduced, that probably overrode the old filter by accident and added the new filter by docker.manifest property criteria.

      What is the impact to the customer

      Causes wrong tags to be deleted, so they have to redeploy them

      Workaround:

      Set Tag retention period to higher number

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              mattheww Matthew Wang
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26260 -
                  SYNCHRONIZED
                  • Last Sync Date: