Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Argo CD Image Updater causes an infinite loop of syncs with ApplicationSets #547

Open
RiverPhillips opened this issue Mar 14, 2022 · 7 comments

Comments

@RiverPhillips
Copy link

Describe the bug
I am using ApplicationSets to deploy multiple applications, the template for this ApplicationSet is creating applications with the required annotations for the image updater. This leads to the applications syncing constantly.

I cannot use git writeback with the Argo image updater as I want to ensure the image tagged main is always deployed.

I have raised a bug with the Argo CD Image updater and they suspect the issue lies with ApplicationSets

To Reproduce
Steps to reproduce the behaviour:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: name
  namespace: argocd
spec:
  generators:
  - git:
      directories:
      - path: manifests/*/overlays/dev
      repoURL: [email protected]:org/repo.git
      revision: HEAD
  template:
    metadata:
      annotations:
        argocd-image-updater.argoproj.io/image-list: app=foo:main
        argocd-image-updater.argoproj.io/app.update-strategy: digest
      name: '{{path[1]}}'
    spec:
      destination:
        namespace: name
        server: https://kubernetes.default.svc/
      project: project
      source:
        path: '{{path}}'
        repoURL: [email protected]:org/repo.git
        targetRevision: HEAD

Expected behaviour
When the image digest changes there should be a sync, but this should not be an infinite loop.

Version
Argo CD: v2.3.1
Argo CD Image Updater: v 0.11.3

@synthe102
Copy link

Same issue here. Having an option to ignore the tag of the image would be great.

@jizusun
Copy link

jizusun commented May 9, 2023

Do we have any workaround?

@sali2801
Copy link

sali2801 commented May 9, 2023

what about if you add write-back-method. From the doc:

As a rule of thumb, if you are managing Application in Git (i.e. in an app-of-apps setup), you most likely want to chose the Git write-back method.

@dorsegal
Copy link

I am experiencing the same issue. Also the logs show that the image was updated but nothing happens on Argocd Application side. maybe related to this argoproj-labs/argocd-image-updater#431

@kyleli666
Copy link

kyleli666 commented Aug 11, 2023

I found a workaround is to change the policy of ApplicationSet controller - https://argocd-applicationset.readthedocs.io/en/stable/Controlling-Resource-Modification/#policy-create-only-prevent-applicationset-controller-from-modifying-or-deleting-applications
Use a policy that does not include "update", e.g. "create-delete" in my case in Helm values

## Argo Configs
configs:
  # Argo CD configuration parameters
  ## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/argocd-cmd-params-cm.yaml
  params:
    ## ApplicationSet Properties
    # -- Modify how application is synced between the generator and the cluster. One of: `sync`, `create-only`, `create-update`, `create-delete`
    applicationsetcontroller.policy: create-delete

Then ApplicationSet will not be able to apply any updates in Applications, so image updater finally gets the chance to work.

@jessebye
Copy link

Should be resolved by argoproj/argo-cd#14743

@jessebye
Copy link

@kyleli666 Yes, this workaround is OK as long as you don't need updates to your applications to be synced. In our case, we need to update the applications sometimes to change things like the ref, so we can't use the workaround.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants