Skip to content

Conversation

@CharlieR-o-o-t
Copy link

Fixed a bug where child Applications in App-of-Apps pattern would stop syncing correctly when RespectIgnoreDifferences sync option is enabled together with global ignoreDifferences configuration targeting fields within arrays.

Problem

When using the App-of-Apps pattern with the following configuration:

  • RespectIgnoreDifferences=true sync option
  • Global ignoreDifferences in argocd-cm ConfigMap with jqPathExpressions targeting array fields, e.g.:
 resource.customizations.ignoreDifferences.argoproj.io_Application: |
   jqPathExpressions:
   - '.spec.sources[] | select(.path == "") | .path'

The targetRevision field in child Application's spec.sources[] would not update during sync. The diff would correctly show the desired targetRevision change, but after sync the value would remain unchanged, effectively preventing version updates in multi-source Applications.

Root Cause

The normalizeTargetResources function in controller/sync.go uses JSON Merge Patch (RFC 7386) to apply normalization from live state to target resources for CRDs. JSON Merge Patch has a fundamental limitation: it replaces arrays entirely rather than merging individual elements.

When ignoreDifferences targets a field within an array element (like .spec.sources[].path), the normalization process would:

  1. Create a merge patch that includes the entire sources array from live state
  2. Apply this patch to the target, replacing the entire array
  3. This overwrites targetRevision values from target with values from live state

Solution

Changed the patching strategy for CRDs from JSON Merge Patch (RFC 7386) to JSON Patch (RFC 6902):

  • JSON Merge Patch (RFC 7386): {"spec": {"sources": [entire array from live]}}- replaces whole array
  • JSON Patch (RFC 6902): [{"op": "replace", "path": "/spec/sources/1/path", "value": ""}] - granular operations on specific paths

@CharlieR-o-o-t CharlieR-o-o-t requested a review from a team as a code owner February 11, 2026 19:43
@bunnyshell
Copy link

bunnyshell bot commented Feb 11, 2026

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-gsxuu2.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-gsxuu2.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant