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

Namespace support

Open rossigee opened this issue 1 year ago • 2 comments

Add --namespaced flag, that when true will only monitor the configured namespace for applications. If it is false, then monitor all namespaces for applications.

By default this is set to true to preserve the current behavior.

fixes https://github.com/argoproj-labs/argocd-image-updater/issues/601

(Picking this up from @iandelahorne - https://github.com/argoproj-labs/argocd-image-updater/pull/612#issuecomment-1910674396)

rossigee avatar Jan 26 '24 00:01 rossigee

Thanks @rossigee for picking this up.

ElanHasson avatar Jan 30 '24 01:01 ElanHasson

Does this also solve the issue of wrong namespace when creating the ApplicationEvent?

I face the issue where image-updater throws an error in kube/kubernetes.go on line 128:

Event "xxxx" is invalid: involvedObject.namespace: Invalid value "xxxx": does not match event.namespace

I was thinking of testing to change the namespace used in the command:

result, err := client.Clientset.CoreV1().Events(app.ObjectMeta.Namespace).Create(client.Context, &event, metav1.CreateOptions{})

to use the namespace of the found app instead of the client.Namespace.

strangnet avatar Feb 01 '24 15:02 strangnet

Hello, any update on this? Thx!

fad3t avatar Apr 04 '24 10:04 fad3t

I need this-- I am happy to work with someone to get this handled.

ElanHasson avatar Apr 09 '24 22:04 ElanHasson

Hi @jannfis, any chance you could take a look and provide some feedback here?

ElanHasson avatar Apr 09 '24 22:04 ElanHasson

Sorry guys, I'm going to have to abandon this PR.

The reason is that ArgoCD image updater doesn't appear to fit my use case, as the majority of the image tags I need it to update appear on Application manifests that wrap Helm releases.

Here's an example...

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: myapp
  namespace: mynamespace
spec:
  project: myapp
  destination:
    server: "https://kubernetes.default.svc"
    namespace: mynamespace
  source:
    chart: myapp
    repoURL: registry.mydomain.lan/charts
    targetRevision: 1.2.3
    helm:
      releaseName: myapp
      valuesObject:
        replicaCount: 1
        image:
          repository: registry.mydomain.lan/mynamespace/myapp
          tag: "1.0-123-ce3e866"

As the repoURL is an OCI chart repository and not a git repo (as ArgoCD seems to assume!) it fails at the first step, as it can't git clone it !

As far as I can see there is no other way to manage the above manifest, so this tool is not going to work for me. I may have to try 'kobold' instead, but even that needs patching due to it not handling the split repository and tag style commonly found in Helm charts, as per the above example.

rossigee avatar Apr 14 '24 13:04 rossigee