Closed chris-schra closed 1 year ago
The dry-run setting is pretty new and it seems it hasn't been implemented entirely correctly. See this section of code: https://github.com/snok/container-retention-policy/blob/main/main.py#L375:L391
I guess to behave correctly, it should be:
-if inputs.dry_run:
+if delete_image is True and inputs.dry_run:
delete_image = False
print(f'Would delete image {image_name}:{version.id}.')
A PR is welcome if you have time 👍
thanks for the hint, seems to work
Creating PR - with a disclaimer ;)
Thanks @chris-schra! If you haven't already, it'd be great if you tested the new version (which should be out in a few seconds). Thanks for the report and PR :clap:
@sondrelg thanks for the fast merge.. still in dry-run, but so far it looks pretty good. Thanks for the work!
First of all: thanks for the useful action. I'm currently integrating it in our chore repo and as we have different deployment environments (reflected in the image tags), my idea is, to filter-tags by environment name (from a matrix), like this:
It seems, the execution (in terms of filter-tags string building) works as expected:
I expected that the dry-run will only return a few results, but it seems filter-tags is not working and dry-run states it would delete all tags older than a month (can't tell if keep-at-least is honored). Is there something wrong with my logic or with the filter-tags arg?