Container registry keep_n is not working as expected
Summary
Hi, I'm running a helm-based Gitlab v13.0.0-ee and I would like to use the registry API (not the UI) in order to clear and remove some tags but the keep_n attribute seems to not work as expected and remove all the tags except the latest one.
The URL I'm calling is
curl -s -L -X DELETE "https://gitlab.mydomain.com/api/v4/projects/${project_id}/registry/repositories/${repository_id}/tags?name_regex=.*&keep_n=3&older_than=1d" -H "PRIVATE-TOKEN: ${PERSONAL_TOKEN}"
What is also strange is that the containeer registry is showing multiple "tags" without image ID that are always created "just now" and has a few bytes.
Steps to reproduce
- Install Gitlab with Helm.
- Add tags on container registry.
- Remove tags with keep_n, name_regex and older_than attributes.
URL:
curl -s -L -X DELETE "https://gitlab.mydomain.com/api/v4/projects/${project_id}/registry/repositories/${repository_id}/tags?name_regex=.*&keep_n=3&older_than=1d" -H "PRIVATE-TOKEN: ${PERSONAL_TOKEN}"
Configuration used
USER-SUPPLIED VALUES:
USER-SUPPLIED VALUES: null
certmanager:
install: false
certmanager-issuer:
email: mh@mydomain.com
gitlab:
migrations:
enabled: false
gitlab-runner:
runners:
privileged: true
global:
email:
display_name: Adibox
from: xxx@gmail.com
reply_to: xxx@gmail.com
hosts:
domain: mydomain.com
https: true
ingress:
annotations:
kubernetes:
io/tls-acme: true
tls:
enabled: false
smtp:
address: smtp.gmail.com
authentication: login
enabled: true
openssl_verify_mode: peer
password:
secret: smtp-gmail
port: 587
starttls_auto: true
user_name: xxx
registry:
maintenance:
readOnly:
enabled: false
Current behavior
Remove all tags except latest.
Expected behavior
Keep last 3 tags.
Versions
- Chart: 4.00
- Platform:
- Cloud: GKE
- Kubernetes: (
kubectl version
)- Client: 1.19
- Server: 1.16
- Helm: (
helm version
)- Client: 3.2.1
Thank you.
Edited by Martin Hogge