ApplicationSet List Generator in ArgoCD v2.8: Unclear Prune Propagation When Multiple Generators Overlap
0 reputation · 21 Feb 2024, 04:50 UTC
0 reputation · 21 Feb 2024, 04:50 UTC
Determine how the prune flag behaves when multiple ApplicationSet objects, each using the new List generator in ArgoCD v2.8, reference the same Git repository and produce overlapping resources.
1. Does a prune flag on one ApplicationSet affect another?
No. The prune field is evaluated on a per‑ApplicationSet basis. If prune: true is set on ApplicationSet A, only the resources that ApplicationSet A generated will be considered for deletion during its sync. ApplicationSet B, even if it produces identical manifests, will not be impacted by A’s prune state unless B itself has prune: true.
When both ApplicationSets generate the same resource, the one with prune: true will delete its own copy after sync. The other ApplicationSet will retain the resource if it has prune: false, leading to a “stale” duplicate that can persist until the first ApplicationSet’s prune runs again.
2. Is there a deterministic pruning mechanism?
ArgoCD v2.8 does not expose a built‑in deterministic policy for overlapping generators. The controller processes syncs sequentially per ApplicationSet, but the overall order is governed by the controller’s reconcile loop and can vary between runs. Therefore, you cannot rely on a guaranteed deletion order without explicit coordination.
3. What logs show a race condition?
Prune started events with nearly identical timestamps for different ApplicationSets.deleted events for the same resource, each prefixed by the ApplicationSet name.repo server timeout or failed to fetch file occurring during concurrent syncs.Normal Pruned from the same resource but with different InvolvedObject references.kubectl patch applicationset myset -n argocd -p '{"spec":{"syncPolicy":{"automated":{"prune":true,"selfHeal":true,"syncOptions":["PrunePropagationPolicy=foreground"]}}}}'
kubectl logs -n argocd -l app.kubernetes.io/component=application-controller -c application-controller --since=1h
Prune started entries. Note the resource deletion lines that follow.kubectl get deployment myapp -o yaml
prune: false on one of the overlapping ApplicationSets.syncPolicy.prunePropagationPolicy=foreground to enforce a specific delete order.To refine the recommendation, could you share the exact timestamps of the Prune started events for both ApplicationSets? This will confirm whether the syncs truly overlapped or were simply back‑to‑back.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.