Skip to content

Provide flag to import metadata about dangling manifests

Context

In !136 (merged) we have introduced an experimental tool to import metadata from a registry filesystem into a database.

Problem

Currently, the import tool first loops over all manifests in a repository and then over tags. Because we loop over all manifests first, it means that the import tool is currently importing dangling (untagged) manifests by default. This makes the import process take longer and also imports dangling data.

Solution

We should not import dangling manifests by default. Instead, we should provide a -m flag (similar to that in the garbage-collect command) to make that optional. When the flag is provided, we should import metadata as we do now (first all manifests, then all tags). Otherwise, if not set, we should first loop over all tags, and for each one of them, import the referenced manifest. This ensures that by default, we do not import dangling manifests.