You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here when 'keep_last_versions' is 0, instead of taking the full list, it returns an empty list.
Should we have a specific case when '--num' is 0 and have something like:
if keep_last_versions == 0:
tags_list_to_delete = ordered_tags_list
else:
tags_list_to_delete = ordered_tags_list[:-keep_last_versions]
The text was updated successfully, but these errors were encountered:
I have a scenario where I want to delete images with a tag matching a regex and keeping the ones for the last week.
The corresponding command is:
docker run --rm anoxis/registry-cli --no-validate-ssl -l ":" -r https://*** -i "my-image" --dry-run --delete --tags-like "^my-regex$" --num 0 --keep-by-hours 168
In that case however nothing is deleted, even tags which are older than one week.
As per my understanding this is because when computing the tags to delete there is an issue if the number of tags to keep is 0 (https://github.com/andrey-pohilko/registry-cli/blob/master/registry.py#L835):
tags_list_to_delete = ordered_tags_list[:-keep_last_versions]
Here when 'keep_last_versions' is 0, instead of taking the full list, it returns an empty list.
Should we have a specific case when '--num' is 0 and have something like:
if keep_last_versions == 0:
tags_list_to_delete = ordered_tags_list
else:
tags_list_to_delete = ordered_tags_list[:-keep_last_versions]
The text was updated successfully, but these errors were encountered: