Regression: Application targetting an annotated tag will self heal, even when self-healing is disabled. #21548
Labels
bug
Something isn't working
component:sync
regression
Bug is a regression, should be handled with high priority
version:2.11
Latest confirmed affected version is 2.11
Describe the bug
Note: The cause of this bug is likely the same as #20082. I have opened this current bug to track another failing case, but it likely shares the same root cause as #20082. See that bug for some additional details.
In Git, there are two types of tags: annotated tags and lightweight tags. Annotated tags may have a message/data attached to them, while lightweight tags do not. This means that annotated tags have their own ID (different from the commit SHA), while lightweight tags do not. The ID of the lightweight tag is the same as the target commit SHA.
However, Argo CD behaviour currently differs when
.spec.source.targetRevision
points to an annotated tag, versus a lightweight tag. This appears to be a regression that was introduced in April 2024, based on 'git bisect' testing.When:
automatedSync: true, selfHealing: false
Then:
selfHealing: false
But at present, selfHealing WILL occur when the targetRevision is an annotated tag, in some cases.
In contrast, when you use a lightweight tag, rather than an annotated tag, the behaviour is correct and as expected (no self healing).
To Reproduce
Automated test:
I wrote an Argo CD E2E test case that reproduces the problem:
Manually:
.spec.source.targetRevision
.Wait for it to sync.
Update a K8s resource in your gitops repository (for example, updating
.spec.revisionHistoryLimit
of a Deployment). Push that new commit.Update annotated tag to point to new commit.
Do a hard refresh in the Argo CD UI.
Wait for Argo CD to reconcile the K8s resource (e.g.
.spec.revisionHistoryLimit
of a Deployment) to the new value in Git.Within K8s itself, update that same K8s resource. (e.g. update
.spec.revisionHistoryLimit
of a Deployment to a value that is different from what is in git).Fail: Even though the Application is
selfHeal: false
, you will see the change that was made in step 8 is reverted to the previous version of the resource from step 5. (e.g..spec.revisionHistoryLimit
of Deployment has changed back to the value in Git, even though it should not)Version
See #20082 for detailed description of what caused the regression, but TL;DR: this behaviour is currently present in v2.11.x, v2.12.x, v2.13.x and current
master
.Checklist:
argocd version
.The text was updated successfully, but these errors were encountered: