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

CreateApplicationEvent failure when App is in other namespace

Open jortkoopmans opened this issue 5 months ago • 1 comments

Describe the bug When running (latest/master branch) updater, with Applications in other namespaces, Events will fail to be published, with a message like:

time="2024-08-29T17:04:39Z" level=warning msg="Event could not be sent: Event \"my-application.17f041de2f74d240\" is invalid: involvedObject.namespace: Invalid value: \"the-application-namespace\": does not match event.namespace" application=my-application

To Reproduce Steps to reproduce the behavior:

  • Configure an Application in another namespace than where the argocd-image-updater is running
  • Configure update method argocd (not using kubernetes client, this is currently broken I think, but that's another issue)
  • Trigger an update, that requires an Event to be published

Result is that the event is not published, this warning is logged instead.

Expected behavior Events are published

Additional context This is related to recent functionality on Apps in other namespaces. Looking at the code, it seems to boil down to the kubernetes client being initiated in a particular namespace, which is not matching the Application.

I have a branch that resolves this issue (for me at least), which I will link to this issue for review.

Version v0.14.0 and or built from master.

Logs See above

jortkoopmans avatar Aug 30 '24 16:08 jortkoopmans