-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Server-side Dry-run Syncs #16131
Comments
Any thoughts on this? Is there a pitfall I'm missing, or would implementation be as simple as wiring up a new |
Also it looks like argoproj/gitops-engine#522 (#11574) added code implementing server-side dry-run applies in gitops-engine, so it should be even easier to implement this now, no? |
Indeed, should be resolved with #13663 |
Is there a way to use this with autosync? I have autosync enabled on all my appsets/apps and that means I can't use |
Is it possible to turn off ArgoCD notifications for syncs with |
Summary
Right now on ArgoCD one can only do client-side dry-runs. Even though I see some code in gitops-engine that shows server-side dry-runs are partially supported already, this bit of code makes it so there's no way to actually trigger them: https://github.com/argoproj/gitops-engine/blob/f15cf615b8141a9f0d8e37cf92bac2d0e7a486da/pkg/sync/sync_context.go#L908-L910
A boolean
dryRun
comes in, with true mapping tocmdutil.DryRunClient
and false mapping tocmdutil.DryRunNone
; no way to setcmdutil.DryRunServer
orcmdutil.DryRunAll
.(Note that doing
argocd app sync --dry-run --server-side
does not do a server-side dry-run like I thought it would. It in fact doesn't do a dry-run at all; it does a normal server-side apply that makes changes in the target cluster! Aargocd app sync --dry-run --server-side
command maps to calls ofkubectl apply --dry-run=client --server-side
, not calls ofkubectl apply --dry-run=server
.)Motivation
I've built a system that validates template/manifest changes via ArgoCD dry-run syncs before allowing them to merge to the
main
branch for actual sync by ArgoCD. We want to catch as many errors as early as possible, and a server-side dry-run is far more meaningful than a client-side dry-run. I can't easily do direct calls ofkubectl apply --dry-run=server
on the changed manifests as a workaround, because by design this system doesn't know about every target cluster out there, only our centralized ArgoCD servers do.Proposal
I suggest changing the
argocd app sync
boolean--dry-run
CLI arg (and the corresponding Application resource sync option bits) to match whatkubectl
does with a string value:--dry-run=client
,--dry-run=server
, etc.The text was updated successfully, but these errors were encountered: