Bulk delete container tags via api not working

Bulk delete container tags via api

tags count:

curl --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" https://gitlab.com/api/v4/registry/repositories/$REPO_ID?tags_count=true | jq .tags_count
=> 4837

remove old tags:

curl --request DELETE --data 'name_regex_delete=.*' --data 'older_than=1month' --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/$PROJECT_ID/registry/repositories/$REPO_ID/tags"
=> no response (200 I guess?)

Wait reasonable time for async op, recheck:

curl --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" https://gitlab.com/api/v4/registry/repositories/$REPO_ID?tags_count=true | jq .tags_count
=> 4837

Try rerun:

{"message":"This request has already been made. You can run this at most once an hour for a given container repository"}

Any obvious mistake here?

Thanks!

@seocahill This limit is hard-coded. You can modify it yourself - two options:

  1. Reduce the threshold from 1.hour to 5.minutes: lib/api/project_container_repositories.rb · master · GitLab.org / GitLab FOSS · GitLab
  2. Don’t obtain an exclusive lock at all by replacing unless obtain_new_cleanup_container_lease with unless true: lib/api/project_container_repositories.rb · master · GitLab.org / GitLab FOSS · GitLab