Skip to content

argocd-update with updateTargetRevision: false syncs the stale target revision before an ApplicationSet has applied the new one #8147

In progress

Description

@Manuelraa

Pre-submission checklist

  • I have searched existing issues and confirmed this is not a duplicate.

Description

When an Application's chart version is owned by an ApplicationSet, argocd-update with updateTargetRevision: false and a desiredRevision syncs the Application at its current target revision, which is still the old one right after git-push. It then sees that the sync result doesn't match desiredRevision and starts a second sync, by which time the ApplicationSet has picked up the push.

The result is correct, but every promotion runs a full extra sync at the old version, including all PostSync hooks. In our case that adds about 2–2.5 minutes per promotion. If the new values are incompatible with the old chart, the first sync fails with a ComparisonError instead.

syncApplication creates the operation with sync.revisions: [] and, with updateTargetRevision: false, leaves the sources unchanged, so Argo CD resolves whatever targetRevision is in the spec at that moment:
https://github.com/akuity/kargo/blob/v1.12.5/pkg/promotion/runner/builtin/argocd_updater.go
main behaves the same.

Possible fix: for sources where desiredRevision can be compared to the source's targetRevision (for example Helm chart sources), return Running without starting a sync until the Application's targetRevision equals desiredRevision. Since Kargo already requeues on Application updates, the step would continue as soon as the ApplicationSet writes the new revision.

A desiredRevision option on argocd-wait would also help: it would let Argo CD auto-sync do the deployment while Kargo only waits for the expected revision to be synced and healthy.

Our workaround: before argocd-update, an argocd-wait step with continueOnError: true selects the Application by a version label that the ApplicationSet template writes (app-version: {{ .config.appVersion }}), so the sync only starts once the ApplicationSet has updated the Application.

Steps to Reproduce

  1. Create an ApplicationSet (git files generator) whose template sets a Helm chart source's targetRevision from a value in a file in Git, with automated sync enabled and at least one PostSync hook in the chart.
  2. Define a promotion that updates that file, then runs git-commit and git-push, followed by argocd-update with:
    apps:
      - name: my-app
        sources:
          - repoURL: <chart repo>
            chart: <chart>
            desiredRevision: <new chart version>
            updateTargetRevision: false
  3. Promote a new version and look at the Application's sync history.

Expected Behavior

A single Kargo-initiated sync at the new chart version.

Actual Behavior

Two Kargo-initiated syncs per promotion: the first at the old chart version (PostSync hooks run, about 2–2.5 minutes), the second at the new chart version, starting about one second after the first finishes.

Kargo Version

v1.12.5

Relevant Logs

# status.history (id, deployStartedAt, deployedAt, revisions [values git source, chart], initiatedBy)
2524  09:16:39Z  09:19:08Z  ["b04e31a…","237"]  kargo-controller
2525  09:19:09Z  09:25:22Z  ["b04e31a…","238"]  kargo-controller
2528  10:08:37Z  10:11:07Z  ["1508f31…","239"]  kargo-controller
2529  10:11:08Z  10:17:41Z  ["1508f31…","240"]  kargo-controller

Screenshots

No response

Activity

  1. added
    kind/bug
    on Nov 24, 2026
  2. added
    needs/area
    needs/priority
    on Nov 24, 2026
  3. ItsRoy69 commented on Nov 26, 2026

    @ItsRoy69
    Contributor

    I can work on this issue, can someone from @mainteners assign me ?

  4. krancour commented on Nov 26, 2026

    @krancour
    Member

    @ItsRoy69 that is premature. This has not been triaged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugneeds/areaneeds/priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions