RollingSync in AppSets not removing deleted apps from status.applicationStatus
- Dominant language
- Go
- Stars
- 24.2k
- Forks
- 7.8k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 239
Description
Checklist:
* [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
* [x] I've included steps to reproduce the bug.
* [x] I've pasted the output of `argocd version`.
**Describe the bug**
When using RollingSync in AppSets, I’ve noticed that the `status.applicationStatus` list does not remove apps that are no longer present, causing the status not to match the real value of the app. This behavior is not expected, and I believe it should always show the current status of the apps.
**To Reproduce**
1. Set up an AppSet with RollingSync enabled.
2. Add multiple apps to the AppSet.
3. Observe the `status.applicationStatus` list reflecting the correct status of the apps.
4. Delete one of the apps from the AppSet.
5. Observe that the deleted app is still present in the `status.applicationStatus` list and the status does not match the real value of the app.
**Expected behavior**
The `status.applicationStatus` list should always show the current status of the apps, and it should remove the apps that are no longer present in the AppSet.
**Screenshots**
`

**Version**
```shell
argocd version
argocd: v2.6.7+5bcd846
BuildDate: 2023-03-23T14:57:27Z
GitCommit: 5bcd846fa16e4b19d8f477de7da50ec0aef320e5
GitTreeState: clean
GoVersion: go1.18.10
Compiler: gc
Platform: linux/amd64
```
**Logs**
As you can see, despite the fact that we deleted some of the apps, they are still listed in the endless list of `status.applicationStatus` as pending see below:
```
status:
applicationStatus:
- application: istiod
lastTransitionTime: '2023-04-24T09:43:23Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '1'
- application: keycloak-realm-import
lastTransitionTime: '2023-04-24T10:01:07Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '3'
- application: keycloak
lastTransitionTime: '2023-04-24T13:54:57Z'
message: >-
Application moved to Pending status, watching for the Application
resource to start Progressing.
status: Pending
step: '2'
- application: external-dns
lastTransitionTime: '2023-04-24T09:53:15Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '2'
- application: istio-base
lastTransitionTime: '2023-04-24T09:53:23Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '1'
- application: istio-ingress
lastTransitionTime: '2023-04-24T09:53:23Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '2'
- application: testkube
lastTransitionTime: '2023-04-24T09:56:02Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '3'
- application: cert-manager
lastTransitionTime: '2023-04-24T09:54:16Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '2'
- application: nfs-server-provisioner
lastTransitionTime: '2023-04-24T09:53:49Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '2'
- application: istio-egress-sb
lastTransitionTime: '2023-04-24T09:53:41Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '2'
- application: jaeger
lastTransitionTime: '2023-04-24T09:55:23Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '3'
- application: strimzi-kafka-operator
lastTransitionTime: '2023-04-24T09:54:10Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '2'
- application: vertical-pod-autoscaler
lastTransitionTime: '2023-04-24T09:54:13Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '2'
- application: gitlab-runner-k8s
lastTransitionTime: '2023-04-24T09:53:53Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '3'
- application: kiali
lastTransitionTime: '2023-04-24T13:50:30Z'
message: Application has pending changes, setting status to Waiting.
status: Waiting
step: '1'
- application: kube-hunter
lastTransitionTime: '2023-04-24T09:53:23Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '3'
- application: loki-promtail
lastTransitionTime: '2023-04-24T09:53:56Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '3'
- application: goldilocks
lastTransitionTime: '2023-04-24T12:51:06Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '2'
- application: loki-distributed
lastTransitionTime: '2023-04-24T09:54:33Z'
message: >-
Application resource is already Healthy, updating status from Waiting to
Healthy.
status: Healthy
step: '3'
- application: oauth2-proxy
lastTransitionTime: '2023-04-24T13:50:34Z'
message: Application has pending changes, setting status to Waiting.
status: Waiting
step: '3'
- application: fluentd
lastTransitionTime: '2023-04-24T12:48:19Z'
message: >-
Application resource became Healthy, updating status from Progressing to
Healthy.
status: Healthy
step: '2'
conditions:
- lastTransitionTime: '2023-04-24T09:01:57Z'
message: Successfully generated parameters for all Applications
reason: ApplicationSetUpToDate
status: 'False'
type: ErrorOccurred
- lastTransitionTime: '2023-04-24T14:05:39Z'
message: ApplicationSet Rollout Rollout started
reason: ErrorOccurred
status: 'False'
type: ParametersGenerated
- lastTransitionTime: '2023-04-24T09:01:57Z'
message: ApplicationSet up to date
reason: ApplicationSetUpToDate
status: 'True'
type: ResourcesUpToDate
```
Contributor guide
Research direction
Start by reproducing the RollingSync AppSet scenario described: remove an application and inspect status.applicationStatus. Trace the ApplicationSet RollingSync controller entry point and its status update path, then add coverage for removing deleted applications and verify that the status list matches the generated applications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100