You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my homelab, I've encoutered ocassional removal of argocd managed applications after upgrading to argocd 2.11. Upon further investigation, this always happens when my git server becomes temporarily unavailable.
I'm using https://github.com/argoproj-labs/argocd-autopilot to manage my homelab. In that setup, argocd-autopilot sets up a repository that defines an ApplicationSet that comes with two git generators:
In the scenario that happens quite regulariliy, this isn't the case when argocd is unable to contact the the git repository for one, but not both git generators.
We faced something similar today and the impact was quite serious. Argo deleted a set of applications generated by 1 generator out of our 3 git generators.
spec:
generators:
- git: #Applications under this generator were deleted
repoURL: https://<repo_url>
revision: main
directories:
- path: <path>/acc/*
- path: <path>/int/*
- git:
repoURL: https://<repo_url>
revision: main
directories:
- path: <path>/foo
- git:
repoURL: https://<repo_url>
revision: main
directories:
- path: <path>/dev/*
template:
metadata: {}
spec:
project: ""
sources: []
destination: {}
syncPolicy:
automated:
selfHeal: true
prune: true
We did not see a downtime on our version control provider's status page, but maybe there was a small glitch in the connection.
Background:
We deploy ArgoCD using the helm chart (6.11.1) and Argo app version is (v2.11.2).
We generate our applications using ApplicationSet (multisource).
EDIT:
As already mentioned in the issue, we also think it's because of the lines of code here:
// desiredApplications is the main list of all expected Applications from all generators in this appset.
if len(desiredApplications) < 1 {
return ctrl.Result{}, generatorsErr
}
Our first generator failed to generate applications
desiredApplications = 0
Second and third pass
desiredApplications != 0
So no error gets returned and the sync proceeds with the list generated by second and third generators
In my homelab, I've encoutered ocassional removal of argocd managed applications after upgrading to argocd 2.11. Upon further investigation, this always happens when my git server becomes temporarily unavailable.
I'm using https://github.com/argoproj-labs/argocd-autopilot to manage my homelab. In that setup, argocd-autopilot sets up a repository that defines an
ApplicationSet
that comes with twogit
generators:After inspecting the code around https://github.com/similark/argo-cd/blob/997f5c7da304efa209a32668d768966d75ee8c2e/applicationset/controllers/applicationset_controller.go#L128-L141 a
git blame
brought me to #17062 which I believe is causing this regression. Basically, the thinking in that PR is "if the number of generated projects is more than one, then it is save to take the resulting list as good.In the scenario that happens quite regulariliy, this isn't the case when argocd is unable to contact the the git repository for one, but not both git generators.
Version
Logs
The text was updated successfully, but these errors were encountered: