Double-Starred Patterns

Some Container Registry GUI features allow you to use string matching instead of entering complete names of repositories or tags. That comes in handy if you create separate repositories or tags for every stage in the software development lifecycle and follow a naming convention. In this case, you can select more than one repository or tag by typing in only the pattern once instead of listing all their names.

The star or asterisk symbol helps you to compile such patterns.

For information about how the definition and usage of Patterns such as ** see https://github.com/bmatcuk/doublestar#patterns.

Double Star

In Harbor, and, consequently, Container Registry, you can use a double star/asterisk to do the following:

  • specify that you want to select all names by using the ** without any other characters; for instance, to select all repositories in the tag retention rule dialogue window:

  • specify a part of the name that is the same for all items; for instance, to select all repositories that have “release” in the middle of the name, use:

*release*

Single Star

You can also use only one star/asterisk to specify a string that is either the beginning or the end of a name.

Pattern Stands at the Beginning

For instance, to select all repositories that start with “release”, use:

release*

The star at the end will identify that something is going to come after the pattern.

Pattern Stands at the End

On the contrary, to select all repositories that end with “release”, use:

*release

with the matching pattern at the end and the star/asterisk at the beginning showing that something comes before the pattern.

INFO

Please keep in mind that the single asterisk will stop pattern matching as soon as it stumbles across a separator /. If you need to match any patterns that have separators, typically, a file or repository path, or a complex artifact tag, include the separators into the pattern:

release*/test*/**

It will match with:
release_2021/test_new/1.0