argoproj-labs / argocd-image-updater

Automatic container image update for Argo CD
https://argocd-image-updater.readthedocs.io/en/stable/
Apache License 2.0
1.22k stars 252 forks source link

Allow global write-back defaults #296

Open janpieper opened 2 years ago

janpieper commented 2 years ago

Is your feature request related to a problem? Please describe.

When managing a large amount of applications (e.g. 100+) and all should use the same base configuration for write-back, you're currently forced to touch all applications and add the needed annotations although they are always the same.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app-a
  namespace: argocd
  annotations:
    argocd-image-updater.argoproj.io/write-back-method: git            # same for all apps
    argocd-image-updater.argoproj.io/write-back-target: kustomization  # same for all apps
# ...
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app-b
  namespace: argocd
  annotations:
    argocd-image-updater.argoproj.io/write-back-method: git            # same for all apps
    argocd-image-updater.argoproj.io/write-back-target: kustomization  # same for all apps
# ...
---
# ...

It would be great to be able to configure global defaults. There already is a default for the write-back method, but it is hardcoded in the image updater.

https://github.com/argoproj-labs/argocd-image-updater/blob/226e73160ae5ac7ddf625010620e52428d610528/pkg/argocd/update.go#L404

Describe the solution you'd like

We could add two new flags to the run-command:

jannfis commented 2 years ago

That sounds like a great idea. I'd not oppose an appropriate PR :)