argocd-image-updater icon indicating copy to clipboard operation
argocd-image-updater copied to clipboard

Ability to specify filename for helm based git write back target

Open iangard opened this issue 4 years ago • 1 comments

We would like to use argocd image updater to automatically update the development branch of our application config repo and write back the version to git. This works well. We would then like to promote to test by merging this file into our test branch (which does not use image updater) and eventually prod branch which also does not use image updater. The issue is, each of our applications is named differently, myapp-dev, myapp-test, myapp-prod and the file written to git is ".argocd-source-<appname>.yaml". I would like to make image updater use the ".argocd-source.yaml" instead so it would be honored in all environments like it is documented in Argo docs, https://argo-cd.readthedocs.io/en/stable/user-guide/parameters/#store-overrides-in-git

The solution I am thinking is to make this similar to the kustomize configuration so you could specify: argocd-image-updater.argoproj.io/write-back-target: "helm:/.argocd-source.yaml"

I think the above gives the most flexibility in the case that Argo starts accepting different filenames in future releases. You could also implement it as: argocd-image-updater.argoproj.io/write-back-target: "helm:exclude-appname" or something similar to denote that the templated name of .argocd-source-<appname>.yaml should not be used which aligns with ArgoCD's implementation of either having app name or not.

iangard avatar Nov 01 '21 18:11 iangard

After writing this up and discussing with a colleague, we came up with a work-around until this can be implemented. You can create a symlink from the environment file that you use argocd image updater on to the generic, non app specific filename. We just tested this out and it works as expected.

ln -s .argocd-source-myapp-dev.yaml .argocd-source.yaml Commit symlink file

iangard avatar Nov 01 '21 19:11 iangard