Open macgeneral opened 5 months ago
Is it possible to not raise an error in this case and simply log a warning to stdout?
It's a solution.
We should either explicitly filter out not valid artifacts by using other rules before passing it to the KeepLatestNFilesInFolder
.
KeepLatestNFilesInFolder
was written when there was "docker buildx imagetools create" so feel free to adjust and contiribute the solution if anyone find it!
Hey there,
Thank you for maintaining this great project.
I stumbled across an issue in regards of how I build and tag my docker images.
I first build and push them by digest (so without a tag/label) to build them in a GitHub matrix action for multiple architectures. In a second step I join those images into one manifest using
docker buildx imagetools create
.If artifactory-cleanup stumbles upon such images it crashes if there's a
KeepLatestNVersionImagesByProperty
rule.ValueError: Can not find version in [..]
Note: I did redact some values with
[..]
, also thedocker.label.version
property is manually defined in the Dockerfile and independent from tags etc.A quick and easy fix for this would be to add those two lines after https://github.com/devopshq/artifactory-cleanup/blob/7e5ba2a75c5bd547d0c4df6c099069715ff1ce10/artifactory_cleanup/rules/docker.py#L216
Unfortunately this still results in a crash if it's something completely unexpected like a branch name etc.
Is it possible to not raise an error in this case and simply log a warning to stdout? I would expect artifactory-cleanup to treat those images according to the remaining rules (e.g.
DeleteNotUsedSince
et al).