argocd-image-updater
argocd-image-updater copied to clipboard
Allow global write-back defaults
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:
--default-write-back-method(defaults toargocd)- optionally configurable via ENV-variable:
DEFAULT_WRITE_BACK_METHOD
- optionally configurable via ENV-variable:
--default-write-back-target(only needed if write-back method is notargocd)- optionally configurable via ENV-variable:
DEFAULT_WRITE_BACK_TARGET
- optionally configurable via ENV-variable:
That sounds like a great idea. I'd not oppose an appropriate PR :)