Checklist:
Describe the bug
When an ApplicationSet with a RollingSync strategy changes syncPolicy.automated.prune from true to false, the imperative sync operations triggered by the applicationset controller continue to prune resources. The prune: true value from a previous operation appears to persists on the Application CR and cannot be overwritten.
To Reproduce
- Create an ApplicationSet with
strategy.type: RollingSync and syncPolicy.automated.prune: true
- Trigger a rolling sync — resources are pruned as expected; examining the application spec shows
status.operationState.operation.sync.prune is true
- Change
syncPolicy.automated.prune to false
- Trigger another rolling sync that requires pruning.
Observe that status.operationState.operation.sync.prune is still true and resources are pruned despite the configuration change.
Expected behavior
After changing syncPolicy.automated.prune back to false and triggering a subsequent rolling sync requiring pruning, the following is expected:
- application spec should have
status.operationState.operation.sync.prune omitted or set to false
- resources are not pruned; the sync triggered by rolling Sync remains in a
progressing state
Screenshots
Attempted to add screen shots, but imaged failed to upload. Here are copy and paste snippets instead.
This is the state of my application spec after step 4 from "To Reproduce"
...
spec:
...
syncPolicy: <-------------- syncPolicy with prune omitted
automated:
enabled: false
selfHeal: true
...
status
...
operationState:
finishedAt: "2026-04-09T17:10:57Z"
message: successfully synced (all tasks run)
operation:
info:
- name: Reason
value: ApplicationSet RollingSync triggered a sync of this Application resource
initiatedBy:
automated: true
username: applicationset-controller
retry:
limit: 5
sync:
prune: true <--------------- but it's still set to true during the sync
syncOptions:
- PruneLast=true
- CreateNamespace=true
- ServerSideApply=false
phase: Succeeded
Workaround
Delete the affected Application CR and let the ApplicationSet recreate it. The fresh Application has no lingering operation state, and syncPolicy.automated.prune: false takes effect correctly.
Potential Fix
The AI thinks the issue is here...
Line 1389 in types.go — current code:
Prune bool `json:"prune,omitempty" protobuf:"bytes,2,opt,name=prune"`
Should become:
Prune *bool `json:"prune,omitempty" protobuf:"bytes,2,opt,name=prune"`
Version
~ % argocd version
argocd: v3.2.0+66b2f30
BuildDate: 2025-11-04T19:51:54Z
GitCommit: 66b2f302d91a42cc151808da0eec0846bbe1062c
GitTreeState: clean
GoVersion: go1.25.3
Compiler: gc
Platform: darwin/arm64
argocd-server: v3.3.6
Logs
Paste any relevant application logs here.
Checklist:
argocd version.Describe the bug
When an ApplicationSet with a
RollingSyncstrategy changessyncPolicy.automated.prunefromtruetofalse, the imperative sync operations triggered by the applicationset controller continue to prune resources. Theprune: truevalue from a previous operation appears to persists on the Application CR and cannot be overwritten.To Reproduce
strategy.type: RollingSyncandsyncPolicy.automated.prune: truestatus.operationState.operation.sync.pruneistruesyncPolicy.automated.prunetofalseObserve that
status.operationState.operation.sync.pruneis still true and resources are pruned despite the configuration change.Expected behavior
After changing
syncPolicy.automated.pruneback tofalseand triggering a subsequent rolling sync requiring pruning, the following is expected:status.operationState.operation.sync.pruneomitted or set tofalseprogressingstateScreenshots
Attempted to add screen shots, but imaged failed to upload. Here are copy and paste snippets instead.
This is the state of my application spec after step 4 from "To Reproduce"
Workaround
Delete the affected Application CR and let the ApplicationSet recreate it. The fresh Application has no lingering operation state, and
syncPolicy.automated.prune: falsetakes effect correctly.Potential Fix
The AI thinks the issue is here...
Line 1389 in types.go — current code:
Should become:
Version
~ % argocd version argocd: v3.2.0+66b2f30 BuildDate: 2025-11-04T19:51:54Z GitCommit: 66b2f302d91a42cc151808da0eec0846bbe1062c GitTreeState: clean GoVersion: go1.25.3 Compiler: gc Platform: darwin/arm64 argocd-server: v3.3.6Logs