Docker catalog might not work with include/exclude patterns on virtual repository

Description

Problem description:

Running the _catalog API, against a Docker virtual repository with include/exclude patterns, might produce an unexpected result

What is the expected behavior:

Artifactory should produce the correct Docker catalog, based on the include/exclude pattern of the virtual repository

Steps to reproduce:

  1. Create a local and virtual Docker repos (and put the local in the virtual)

  2. Push 3 Docker images to the local repo:

    1. one that starts with 'a' (for example 'atest')

    2. one with 'b'

    3. and one with 'c'

  3. Remove the default include pattern from the virtual repo (**/) and put these instead:

    1. b*/**

    2. c*/**

  4. Run the catalog request with these parameters:

  • No 'n' flag - expected result

  • 'n=0' - expected result

  • 'n=1' - unexpected result (the bug)

 

This is because Artifactory first creates the subset of all images in the virtual repo and only then applies the include patterns. Therefore, when using 'n=1', then the subset will only hold the image which starts with 'a'. Then, the include pattern rule will remove it, and we are left with an empty result.

 

Workaround:

Set the include pattern on the local repo. This way, the subset will contain only the relevant images.

Environment

None

Activity

Show:
Done

Details

Assignee

Reporter

Severity

High

Affects versions

Created November 15, 2021 at 10:11 PM
Updated January 15, 2023 at 3:45 PM
Resolved January 15, 2023 at 3:45 PM