Skip to content

gitops_bootstrap: Add opt-in ignoreDifferences for child Application CRD tracking drift#125

Merged
wkulhanek merged 2 commits into
mainfrom
fix/gitops-bootstrap-app-of-apps-outofsync
Apr 16, 2026
Merged

gitops_bootstrap: Add opt-in ignoreDifferences for child Application CRD tracking drift#125
wkulhanek merged 2 commits into
mainfrom
fix/gitops-bootstrap-app-of-apps-outofsync

Conversation

@stencell
Copy link
Copy Markdown
Contributor

@stencell stencell commented Apr 16, 2026

Summary

Adds an opt-in variable (ocp4_workload_gitops_bootstrap_application_ignore_tracking, default false) that prevents the bootstrap Application from reporting transient OutOfSync status when child Applications deploy slow-starting, operator-backed workloads.

Problem

When the bootstrap manages a child Application that deploys a complex workload such as an ArgoCD instance (via the OpenShift GitOps operator), the provisioning task "Wait until bootstrap ArgoCD application is healthy and synced" consistently times out — even though all child Applications are Synced + Healthy.

Root causes identified (two, both real):

  1. ArgoCD tracking annotation drift — ArgoCD adds a argocd.argoproj.io/tracking-id annotation to every resource it manages, including child Application CRDs the bootstrap creates. This field is not in the Helm template, so the bootstrap reports OutOfSync during active sync windows.

  2. syncPolicy.automated normalization (separate fix in the consuming repo) — ArgoCD normalizes selfHeal: false and prune: false out of Application CRD specs (they are the defaults). Templates that render these explicitly will always differ from what ArgoCD stores, causing persistent OutOfSync regardless of the annotation fix. The consuming repo must use automated: {} instead of explicit false defaults.

This PR addresses cause #1 via the ignoreDifferences opt-in. Cause #2 must be fixed in the chart templates of the consuming repo.

Changes

defaults/main.yml

Adds ocp4_workload_gitops_bootstrap_application_ignore_tracking: false with a full explanatory comment. Default is falseall existing labs are unaffected unless they explicitly opt in.

templates/application.yaml.j2

Wraps a new ignoreDifferences block in a Jinja conditional. When the variable is true, adds two entries for argoproj.io/Application resources:

  • /metadata/annotations — the tracking-id annotation ArgoCD injects after creation
  • /operation — the transient sync operation field written during active syncs

This does not ignore differences in the Application spec or status — real configuration drift in child Applications remains visible.

Usage

ocp4_workload_gitops_bootstrap_application_ignore_tracking: true

stencell and others added 2 commits April 16, 2026 14:25
ArgoCD adds argocd.argoproj.io/tracking-id to every resource it manages,
including child Application CRDs created by the bootstrap. It also adds
a transient .operation field while a sync is in progress.

Without this ignoreDifferences entry, the bootstrap Application reports
OutOfSync any time a child Application is actively syncing or has been
annotated — even though the actual application workloads are healthy.
This causes provisioning wait tasks to time out when child applications
take longer to reach steady state (e.g. when deploying an ArgoCD instance
or other operator-backed workloads).

The existing RespectIgnoreDifferences=true syncOption means this entry
is already respected during syncs — this change only adds the rule.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…CRD tracking

Add ocp4_workload_gitops_bootstrap_application_ignore_tracking (default: false)
that, when enabled, adds ignoreDifferences rules for /metadata/annotations and
/operation on child Application CRDs managed by the bootstrap.

Default is false — all existing labs are unaffected. Labs that deploy complex,
long-running child workloads (e.g. an operator-backed ArgoCD instance) can opt
in to prevent transient OutOfSync status from blocking provisioning wait tasks.

See defaults/main.yml comment for full explanation.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@stencell stencell marked this pull request as draft April 16, 2026 13:43
@stencell stencell marked this pull request as ready for review April 16, 2026 14:08
@wkulhanek wkulhanek merged commit 2e0756e into main Apr 16, 2026
1 check passed
@wkulhanek wkulhanek deleted the fix/gitops-bootstrap-app-of-apps-outofsync branch April 16, 2026 15:31
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.

2 participants