Removing tags in bulk for a container registry
Summary
Having a registry with multiple tags inside it, trying to use DELETE /projects/:id/registry/repositories/:repository_id/tags
with name_regex doesn't seem to be working.
It will return a 202 status code, the background job will run successfully but nothing happens, no tags have been removed.
Even though in our documentation https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk
We have a snippet to remove all tags but keep the latest x, but that doesn't work either.
curl --request DELETE --data 'name_regex=.*' --data 'keep_n=1' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags"
Steps to reproduce
- Create multiple tags for a registry.
- Try to delete them in bulk
Example Project
https://gitlab.com/rvzon/registry_test/container_registry
What is the current bug behavior?
Nothing happens, tags are not removed.
What is the expected correct behavior?
That the tags are removed.