devopshq / devopshq/artifactory-cleanup
destroy not deleting files on artifactory cloud
- Dominant language
- Python
- Stars
- 160
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
here is my config file:
>
# artifactory-cleanup.yaml
artifactory-cleanup:
server: https://artifactory.mycompany.cloud:443/artifactory
# $VAR is auto populated from environment variables
user: myartuser
password: myartpass
policies:
- name: Keep only the 5 latest Files in a folder
rules:
- rule: Repo
name: "my-docker-repo"
# Keep these tags for all images
- rule: ExcludeDockerImages
masks:
- "*:latest"
# Keep 5 docker tags for all images
- rule: KeepLatestNFilesInFolder
count: 5
here is the output with no --destroy:
podman run --rm -v "$(pwd)":/app devopshq/artifactory-cleanup:1.0.12 artifactory-cleanup
>
DEBUG - we would delete 'my-docker-repo/foo/395416' (f4f50deea25de1d51e80b9aee79d80165ac96cc1) - 159M
Deleted artifacts count: 185
Summary size: 31454366659
+------------------------------------------+-------------+------+
| Cleanup Policy | Files count | Size |
+------------------------------------------+-------------+------+
| Keep only the 5 latest Files in a folder | 185 | 29G |
| | | |
| Total size: 29G | | |
+------------------------------------------+-------------+------+
the same with the --destroy flag:
podman run --rm -v "$(pwd)":/app devopshq/artifactory-cleanup:1.0.12 artifactory-cleanup --destroy
>
DESTROY MODE - delete 'my-docker-repo/foo/395416' (f4f50deea25de1d51e80b9aee79d80165ac96cc1) - 159M
Deleted artifacts count: 186
Summary size: 31639913831
+------------------------------------------+-------------+------+
| Cleanup Policy | Files count | Size |
+------------------------------------------+-------------+------+
| Keep only the 5 latest Files in a folder | 186 | 29G |
| | | |
| Total size: 29G | | |
+------------------------------------------+-------------+------+
and running without the --destroy flag shows the same images again to be deleted and of course in artifactory cloud nothing is deleted:
podman run --rm -v "$(pwd)":/app devopshq/artifactory-cleanup:1.0.12 artifactory-cleanup
>
DEBUG - we would delete 'my-docker-repo/foo/395416' (f4f50deea25de1d51e80b9aee79d80165ac96cc1) - 159M(f4f50deea25de1d51e80b9aee79d80165ac96cc1) - 159M
Deleted artifacts count: 186
Summary size: 31639913831
+------------------------------------------+-------------+------+
| Cleanup Policy | Files count | Size |
+------------------------------------------+-------------+------+
| Keep only the 5 latest Files in a folder | 186 | 29G |
| | | |
| Total size: 29G | | |
+------------------------------------------+-------------+------+
Interesting is also I use the exact same version to cleanup my onprem artifactory repo. And there it works like a charm. So, I guess it's related to artifactory cloud.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.