zuul-jobs/roles/remove-registry-tag
Vladimir Kozhukalov 444f75b5f6 [remove-registry-tag] Allow using in a loop
The role remove-registry-tag can not be used within
ansible loop because it sets the remove_registry_tag_api_url
variable if it is not defined and then this variabled is
never redefined during second and later iterations of the
loop.

Change-Id: I1880efc0d7d94ade7b529b1462fe15e8a58bdfc4
2025-02-13 01:51:20 -06:00
..

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