feat(reconcile): add export command to generate desired-state YAML from current state#1731
feat(reconcile): add export command to generate desired-state YAML from current state#1731rohilsurana wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds an export capability to the reconcile framework: a new ChangesReconcile Export Feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 75607dba-a629-489d-b90a-5de555cb5f68
📒 Files selected for processing (5)
cmd/reconcile.gointernal/reconcile/platformuser_reconciler.gointernal/reconcile/platformuser_reconciler_test.gointernal/reconcile/reconcile.gointernal/reconcile/reconcile_test.go
Coverage Report for CI Build 28634880341Coverage increased (+0.09%) to 44.924%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
What
Adds
frontier reconcile export --kind <Kind>. It reads the current state of one kind from the server through the admin API and prints it as a desired-state YAML document. Output goes to stdout, or to a file with-o.Why
When an environment adopts the reconcile flow, its first desired-state file must match what already exists on the server. If it does not, the first apply makes unwanted changes. Writing that file by hand from list APIs is slow and easy to get wrong.
How
Exporterinterface next toReconciler. A kind that implements it can be exported. Kinds that do not implement it return a clear error.PlatformUserimplements it: one entry per principal and relation, users referenced by email when they have one, service users by id. The bootstrap service account is skipped, the same as in reconcile.spec: [], which reconcile accepts as an intentional empty list.Guarantees covered by tests
reconcile --dry-runreports no changes.