Skip to content

Argo CD diffs: server-side diff and ignoreDifferences for fields that the cluster adds or mutates #217

Open

Description

@ephico2real2

Question from the owner (2026-11-14)

"kubernetes always adds metadata to objects created - and argocd will cry of differences - so did you plan to ignore differences in the argocd application yaml?"

The design today

docs/02, "On the cluster": Argo CD compares only the keys in Git, so keys that controllers add later (OpenShift's openshift.io/sa.scc.*, the pod-security sync labels, kubernetes.io/metadata.name) never show as drift. Each rendered Namespace carries argocd.argoproj.io/sync-options: Prune=confirm,ServerSideApply=true (cmapi/src/cmapi/core/render/manifests.py:30). There is no ignoreDifferences in the planned Applications. Nothing of this is measured: no Argo CD runs for cmapi yet (Wave 2; #157).

The gaps to close in Wave 2

  1. Defaults inside fields that are in Git. The API server can default or normalise values inside objects that cmapi renders (quantities in ResourceQuota and LimitRange, LimitRange defaults). Argo CD's client-side diff can report these. Research Argo CD's server-side diff (ServerSideDiff=true as a compare option on the Application or the resource) for the Argo CD version the hub runs, and turn it on for the cluster Applications if it fits.
  2. Mutations by admission controllers. If a Kyverno MutatingPolicy (Kyverno policies generated from cmapi's configuration, with approved per-namespace overrides #212) or another webhook changes a field that is in Git, Argo CD sees a difference on every reconcile. Decide between server-side diff and an ignoreDifferences entry (managedFieldsManagers or jqPathExpressions) with RespectIgnoreDifferences=true, so a sync does not undo the mutation.
  3. Measure it. On kind (Wave 2) and then CRC: create a namespace through cmapi, let OpenShift and Kyverno add their fields, and show that the Application stays Synced and Healthy; then change a Git-owned key by hand and show self-heal reverts it, and add an unmanaged key by hand and show it stays and appears in the drift report.

Record the decision and its sources (the Argo CD documentation for the pinned version) in docs/reviews/, and update docs/02, "On the cluster".

Activity

  1. added
    task
    status:open
    Backlog
    on Nov 14, 2026
  2. added a commit that references this issue on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backlogstatus:opentask

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions