feat(egctl): add `x migrate deprecated` command #10677
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.63) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 276 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.336
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #10677"
general
weight: 0.35
zirain
What this PR does / why we need it:
This adds
egctl x migrate deprecated, which rewrites manifests to the replacement fields so users canupdate them before upgrading.
Why a migrate command rather than a check command. Policies and EnvoyProxy already report
deprecated fields in their status, so a command that only lists them adds little. The hard part
is the rewrite, because several replacements aren't plain renames.
Design
be reverted.
-ftakes files, directories or stdin, and--modeisprint(default),in-placeorcheck-only. The tool edits the YAML tree directly, so comments, field order andindentation are kept, and documents with nothing to migrate are written back byte for byte.
--from-clusteris read-only for now. It prints the migrated objects without server-setfields. Objects managed by Helm, Argo CD or Flux are reported as errors and left unchanged, so
users fix them in their source.
- Telemetry
host/portis migrated only when the host is a Service DNS name. Any otherhost is an error, because egctl never creates
Backendresources.- The EnvoyGateway configuration is never rewritten (ConfigMap, file or Helm values), since
it's usually rendered from Helm values.
migrateis a parent command with aPathinterface, so later migrations canbe added as
egctl x migrate <path>.Behavior notes for reviewers:
hostmigrated to a ServicebackendRefsentry makes Envoy use the Service'sendpoints instead of resolving its DNS name. This is noted in the report and the docs.
cmd/egctl/main.gonow exits with the code carried bymigrate.ExitError; before, everyerror exited with 1.
Follow-up:
--from-cluster --mode in-placefor test clusters. It's rejected in this PR.The planned safeguards are two confirmations (the second asks the user to type the context
name), a server-side dry-run that catches fields pruned by old CRDs, a backup of the originals,
and updates with optimistic concurrency.
Which issue(s) this PR fixes:
Part of #10211