7 Commits

Author SHA1 Message Date
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
Zuul
9edd78d72a Merge "Use consistent registry type var name across roles" 2025-01-28 14:42:33 +00:00
Vladimir Kozhukalov
7932e7ccc9 [remove-registry-tag] Fix typo
Change-Id: I020b0bc990a8ac8466c1696a8787221792e2ef28
2025-01-10 06:44:21 -06:00
Clark Boylan
0058b0ee7d Use consistent registry type var name across roles
This updates the remote-registry-tag role to use
container_registry_credentials[registry].type to specify quay or docker
API types. This aligns this roles' behavior with ensure-quay-repo's
behavior.

Change-Id: I098dfbfd7d7a744ad6a66d9d8abc109b0fb6254a
2023-04-26 22:34:07 +00:00
Ian Wienand
7bbe8f5b0d
remove-registry-tag: no_log assert
Just to be sure, add no_log here.  Since the actual authenticated call
is no_log too; if this fails you at least know you didn't get the
credentials layout right which narrows down the problems the actual
call might be facing.

Change-Id: Ic7174c10f4e693f6a2c0554dc66ea22fd28d678f
2023-04-05 07:38:54 +10:00
Ian Wienand
507dfdad6b
remove-registry-tag: update docker age match
Update this match to be a little shorter and use datetimes more
directly.

Change-Id: I2012091a16b5b5ddb522a5e5ac6976c4f4c580af
2023-04-04 09:56:26 +10:00
Ian Wienand
fec27296c8
remove-registry-tag: role to delete tags from registry
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
2023-04-04 09:53:18 +10:00