This is a role to abstract removal of tags from registries, which is an operation that practically has to be done via the registry API. This implements removing tags from the quay and docker API's. For the common case of working with a repository like "quay.io/org/project" there is minimal configuration. However, if you run a private repository, this is flexible with a few extra variables to tell the role to use the quay API but your own URL. By default it clears out old tags from the Zuul promote pipeline. However if you set registry_tag_remove_tag it will only remove that one tag. This is inspired by the current work done in promote-docker-image role. Change-Id: I7f2d9d00024e34451e2d20b2c2f8171ecd151943
3.0 KiB
Remove tags from registry
This role creates a generic interface for removing tags from a container registry. The OCI distribution API (implemented essentially all registries) does specify a tag deletion endpoint, but as at 2023-03 essentially no registries implement it. This means practically we must talk to the per-registry API directly to remove tags. The methods to delete tags are generally similar across registries, but differ slightly in endpoint names, etc.
This role can run in two modes; either removing a single specific tag, or it can run a cleanup process removing all tags that match a given prefix and have not been modified in a given amount of time.
For public registries this role should guess the API from the repository name. If you are running against a private registry, you will need to explicitly specify the API type and URL prefix to communicate to using arguments below.
Role Variables