Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destroy not deleting files on artifactory cloud #152

Open
GitarPlayer opened this issue Dec 4, 2024 · 0 comments
Open

destroy not deleting files on artifactory cloud #152

GitarPlayer opened this issue Dec 4, 2024 · 0 comments

Comments

@GitarPlayer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant