You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement crossplane project simulate as an alpha command, per the accepted design (crossplane/cli#181, design/one-pager-cli-simulate.md).
provider plan servers lands separately, until then the command behaves as --skip-plan always.
This includes the groundwork the design bases simulate on: bringing the crossplane-diff machinery into crossplane/cli as internal packages, with its maintainers' involvement, per "Building on crossplane-diff, Not Beside It".
The flow:
Discover. Parse the project file, find Compositions under the project's API paths, list the XRs on the target cluster whose type each Composition composes. --namespace and --name scope the run.
Prepare. Build the project's embedded functions locally, exactly as project run does.
Render. Re-render each XR with the local Composition and functions, feeding in observed composed resources; resolve required resources with the resolver.
Report. Per-XR diffs, Plan: N to add, M to change, K to destroy summary, output formats below.
Also in scope, per the design:
No-project input mode:-f accepts changed Composition or XR files directly; matching XRs are discovered on the cluster, functions run from the packages installed on the cluster, everything not overridden locally is fetched live.
Pinned XRs:compositionUpdatePolicy: Manual XRs print as deferred by default, simulate with --include-pinned. Exception: when the working tree changes an embedded function, pinned XRs are simulated against their pinned CompositionRevision fetched from the cluster with the locally built functions (function packages are not pinned with the revision until Allow composition pipeline steps to reference specific function revisions crossplane#6139).
Claims: a claim passed as a changed file is converted to its XR with the CLI's existing conversion machinery and simulated; results print under the claim's name.
Output formats:-o plan (annotated manifest, default), -o diff (line-by-line unified diff, Markdown diff-block compatible, what crossplane-diff emits today), -o json|yaml (one typed result per resource).
Flags: as in the design's kong struct (minus the plan-layer flags): -f, --namespace, --name, --include-pinned, --max-iterations, --timeout, --max-concurrency, -o.
Acceptance criteria
Resolver, calculator, dry-run, and comp discovery live as internal packages in crossplane/cli, with crossplane-diff maintainer agreement on ownership recorded (CODEOWNERS).
crossplane project simulate (alpha) previews Composition, embedded function, and XR changes against a live cluster.
-f composition.yaml works without a project.
Pinned XRs print as deferred with the documented message; the function-change exception simulates them against their pinned revision.
Claims convert and simulate; output uses the claim's name.
Removed resources appear as deletes; nothing silently disappears from the preview.
All formats work; JSON/YAML results are typed and stable enough for CI gating.
Cost scales with what is previewed: no cluster-wide work beyond the scoped discovery.
Out of scope
Plan servers, --provider-images, --skip-plan, --keep-plan-servers (follow-up issue: plan layer)
Replace detection and known-after-apply values (provider knowledge; plan layer)
What
Implement
crossplane project simulateas an alpha command, per the accepted design (crossplane/cli#181, design/one-pager-cli-simulate.md).provider plan servers lands separately, until then the command behaves as
--skip-planalways.This includes the groundwork the design bases simulate on: bringing the crossplane-diff machinery into crossplane/cli as internal packages, with its maintainers' involvement, per "Building on crossplane-diff, Not Beside It".
The flow:
--namespaceand--namescope the run.project rundoes.Plan: N to add, M to change, K to destroysummary, output formats below.Also in scope, per the design:
-faccepts changed Composition or XR files directly; matching XRs are discovered on the cluster, functions run from the packages installed on the cluster, everything not overridden locally is fetched live.compositionUpdatePolicy: ManualXRs print as deferred by default, simulate with--include-pinned. Exception: when the working tree changes an embedded function, pinned XRs are simulated against their pinned CompositionRevision fetched from the cluster with the locally built functions (function packages are not pinned with the revision until Allow composition pipeline steps to reference specific function revisions crossplane#6139).-o plan(annotated manifest, default),-o diff(line-by-line unified diff, Markdowndiff-block compatible, what crossplane-diff emits today),-o json|yaml(one typed result per resource).-f,--namespace,--name,--include-pinned,--max-iterations,--timeout,--max-concurrency,-o.Acceptance criteria
crossplane project simulate(alpha) previews Composition, embedded function, and XR changes against a live cluster.-f composition.yamlworks without a project.Out of scope
--provider-images,--skip-plan,--keep-plan-servers(follow-up issue: plan layer)