[gitops-bootstrap] Trigger immediate sync after Application creation#116
Open
sborenst wants to merge 1 commit intoagnosticd:mainfrom
Open
[gitops-bootstrap] Trigger immediate sync after Application creation#116sborenst wants to merge 1 commit intoagnosticd:mainfrom
sborenst wants to merge 1 commit intoagnosticd:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Since I created this role myself, I’ll go ahead and jump in. I didn’t know about this new capability built in directly in the One question though: would adding that directly to the This avoids merging the object and makes it a bit cleaner, but not sure if it would work as expected as I haven’t tested this. So basically adding this: Directly here: https://github.com/agnosticd/core_workloads/blob/main/roles/ocp4_workload_gitops_bootstrap/templates/application.yaml.j2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After the
ocp4_workload_gitops_bootstraprole creates the ArgoCD Application, the role immediately begins polling forHealthy + Syncedstatus. However, even withautomatedsync enabled in the Application spec, ArgoCD does not sync immediately on creation — it waits for its next polling interval (default: 3 minutes) before detecting drift and triggering the automated sync.This causes the Ansible wait task to block for up to 3 minutes before ArgoCD even begins syncing, which adds unnecessary provisioning time.
What this PR does
Adds a single task between Application creation and the health/sync wait loop that patches the Application with an
operationblock — the same mechanism the ArgoCD UI "Sync" button uses. This triggers an immediate sync rather than waiting for the next poll cycle.Notes
Testing
Observed in a provisioning environment where
bootstrap-tenant-{{ guid }}consistently sat inOutOfSyncstatus for 2–3 minutes after creation before the automated sync fired. With this change, sync begins within seconds of the Application being created.