Open jakubek opened 6 years ago
That is because the code is sorting images by name (string comparison) so 100 will appear before 90 and be deleted. Believe pull request #29 might resolve it.
So, when we can expect it to be merged?
Its even worse.
I had
nexus-cli image tags -name ff-cfp
latest
v13
v14
v16
v17
v18
v19
v21
v23
v25
v27
v31
v32
v33
v36
v37
v38
v39
v41
v42
v43
v46
v50
v51
There are 24 images for ff-cfp
And did a:
nexus-cli image delete --name ff-cfp --keep 5
ff-cfp:latest image will be deleted ...
ff-cfp:latest has been successful deleted
ff-cfp:v13 image will be deleted ...
ff-cfp:v13 has been successful deleted
ff-cfp:v14 image will be deleted ...
ff-cfp:v14 has been successful deleted
ff-cfp:v16 image will be deleted ...
And it deleted my freshly created latest tag immediately, This makes the whole --keep
option useless!
Looks like the repository is not maintained already.
I fork the repo and fix sorting issue by made image sorting by last modified date. If you still need fix, you can get build binaries from my repo: https://github.com/13rentgen/nexus-cli/releases/tag/v1.1.0
I had registry with 190 tags for image, tags were generated automagically and images were pushed with incremented version number from 1 to 190.
I have decided to remove old images and keep only last 20:
and the effect is:
Nexus-cli version:
nexus@reg:~$ ./nexus-cli --version Nexus CLI version 1.0.0-beta