argocd-image-updater
argocd-image-updater copied to clipboard
Global filters
Is your feature request related to a problem? Please describe.
I have the image-list with 21 images in total. And I want to update all of them with latest strategy, but only if tag has -dev- keyword.
Describe the solution you'd like
I'd like to have global filtering annotation like argocd-image-updater.argoproj.io/<pre/post>-allow-tags: and argocd-image-updater.argoproj.io/<pre/post>-ignore-tags which will be applied pre (before) or post (after) <image_name>-allow/ignore-tags filters.
Describe alternatives you've considered Right now I have to add 21 same annotations for every image.
I do not have 21 images in a single application and I would maybe rethink this, because I can't really come up with any idea why I should have a single application with more than 1-2 images 🤔 But maybe I am just missing something.
I already had a similar idea and I already have a PoC implemented locally 😉 But it differs a bit from your idea... I am a bit unsure if I get your idea correct 🤔 What do you want to achieve with these pre and post prefixes? I thought about having an annotation without the alias to specify one application-wide default.
- Update strategy
- Default:
argocd-image-updater.argoproj.io/update-strategy - per Image:
argocd-image-updater.argoproj.io/<alias>.update-strategy
- Default:
# ...
metadata:
annotations:
argocd-image-updater.argoproj.io/image-list: init=example.azurecr.io/backend-init backend=example.azurecr.io/backend, frontend=example.azurecr.io/frontend
argocd-image-updater.argoproj.io/update-strategy: latest
argocd-image-updater.argoproj.io/frontend.update-strategy: semver
| Image | Update Strategy |
|---|---|
example.azurecr.io/backend-init |
latest |
example.azurecr.io/backend |
latest |
example.azurecr.io/frontend |
semver |
My PoC implements this for update-strategy, ignore-tags, allow-tags and force-update.
Maybe I find some time during my xmas vacation to create a PR for this 😉
I do not have 21 images in a single application and I would maybe rethink this, because I can't really come up with any idea why I should have a single application with more than 1-2 images 🤔 But maybe I am just missing something.
I already had a similar idea and I already have a PoC implemented locally 😉 But it differs a bit from your idea... I am a bit unsure if I get your idea correct 🤔 What do you want to achieve with these
preandpostprefixes? I thought about having an annotation without the alias to specify one application-wide default.
Update strategy
- Default:
argocd-image-updater.argoproj.io/update-strategy- per Image:
argocd-image-updater.argoproj.io/<alias>.update-strategy# ... metadata: annotations: argocd-image-updater.argoproj.io/image-list: init=example.azurecr.io/backend-init backend=example.azurecr.io/backend, frontend=example.azurecr.io/frontend argocd-image-updater.argoproj.io/update-strategy: latest argocd-image-updater.argoproj.io/frontend.update-strategy: semverImage Update Strategy
example.azurecr.io/backend-initlatestexample.azurecr.io/backendlatestexample.azurecr.io/frontendsemver My PoC implements this forupdate-strategy,ignore-tags,allow-tagsandforce-update.Maybe I find some time during my xmas vacation to create a PR for this 😉
Thanks for replay! =)
My point for pre and post prefixes is order for applying filters: pre-allow, then
I thought about having an annotation without the alias to specify one application-wide default.
Sounds great. I like the idea!
Maybe I find some time during my xmas vacation to create a PR for this
This would be awesome!
I think the implementation described by @janpieper-gcx would satisfy the use-case. You could just have allow-tags: regexp:^.*-dev-.*$ to only consider those tags containing -dev- for all applications managed by that application.
@janpieper-gcx Will you send that PR? I favor merging yours over the one I've created and will keep the one I've sent unmerged for a while.
Sorry, I failed to work on this during my xmas vacation :sweat: I just created #338. The functionality is already implemented and should work, but tests and the documentation are still missing.
Uff... I just realized that you already created a PR (#335) for that topic :thinking: Maaaybe we can somehow merge them.
Hey @janpieper, thanks for coming back to it and no sweat. I was just unsure whether you'd send a PR or not, so I hacked something together because what you suggested is really useful :)
As I said, I'd prefer merging your PR over mine, so thanks a lot for submitting yours! I will close mine. Feel free to get as much code off my branch as required, e.g. for the unit tests.