Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
3441ee1
feat(diff): port renderer, types and testutils from crossplane-diff
jcogilvie Oct 18, 2026
02fb7c5
build(nix): fetch Crossplane CRDs for diff tests
jcogilvie Oct 18, 2026
4973dda
feat(diff): port ref, dockerrun and core client from crossplane-diff
jcogilvie Oct 18, 2026
d787a32
chore(diff): resync ported packages with crossplane-diff 9fa7d31
jcogilvie Oct 18, 2026
d8fe172
feat(diff): port kubernetes client from crossplane-diff
jcogilvie Oct 18, 2026
1beac00
feat(diff): port crossplane client from crossplane-diff
jcogilvie Oct 18, 2026
89f62f7
feat(diff): port diffprocessor from crossplane-diff
jcogilvie Oct 18, 2026
3792978
refactor(diff): use render.ErrStaleRenderBackend from the cli
jcogilvie Oct 18, 2026
2ca903c
refactor(diff): use semver v3 for render version checks
jcogilvie Oct 19, 2026
3d68d85
feat(diff): add client bundle constructor
jcogilvie Oct 19, 2026
0d68b48
refactor(project): export function loading for reuse by simulate
jcogilvie Oct 19, 2026
d370275
feat(project): export composition discovery
jcogilvie Oct 19, 2026
f5e01cb
feat(diff): add project function overlay provider
jcogilvie Oct 19, 2026
f03cd90
feat(project): add alpha project simulate command
jcogilvie Oct 19, 2026
2992903
feat(project): exit 3 on changes with project simulate --exit-code
jcogilvie Oct 19, 2026
00bd5da
feat(diff): port crossplane-diff integration tests behind a simulate …
jcogilvie Oct 19, 2026
b2d7bf7
fix(diff): lint the ported integration tests
jcogilvie Oct 19, 2026
adeca17
fix(diff): skip integration environment gaps before the cluster starts
jcogilvie Oct 19, 2026
4d1df09
fix(diff): guard the concurrency test's cluster startup like the runner
jcogilvie Oct 19, 2026
73a4fa8
feat(project): add crossplane-diff flag parity to project simulate
jcogilvie Oct 19, 2026
ee79906
test(kube,diff): cover RESTConfig and client.New
jcogilvie Oct 19, 2026
cad839e
test(diff): enable flag-parity integration cases
jcogilvie Oct 19, 2026
528df3b
test(diff): put integration tests behind the integration build tag
jcogilvie Oct 20, 2026
3bc0afa
build(nix): publish integration test coverage
jcogilvie Oct 20, 2026
ccad2c4
test(diff): run the XR integration cases through the engine harness
jcogilvie Oct 20, 2026
a7cf075
feat(project): add --output-version to project simulate
jcogilvie Oct 20, 2026
c96fc40
feat(project)!: make project simulate's -f a repeatable --input
jcogilvie Oct 20, 2026
15ee7ff
feat(project): simulate Composition and composite resource files
jcogilvie Oct 20, 2026
328f1a1
test(diff): run the integration cases through project simulate
jcogilvie Oct 20, 2026
154c48d
fix(project): stop ignoring last-applied-configuration in project sim…
jcogilvie Oct 20, 2026
926a51e
fix(project): reject -f inputs that are not composite resources
jcogilvie Oct 20, 2026
0caf6dc
feat(project)!: exit 3 when project simulate finds changes
jcogilvie Oct 20, 2026
68f1f01
fix(diff): print errors once, from the command, not inline
jcogilvie Oct 20, 2026
71bf0e7
refactor(diff): move object comparison out of the renderer into compare
jcogilvie Oct 20, 2026
affb1cf
feat(plan): carry composite grouping, errors and revision impact in p…
jcogilvie Oct 20, 2026
a39c6f9
refactor(simulate): move per-resource planning into internal/simulate
jcogilvie Oct 20, 2026
5c45a25
refactor(diff): processors return reports; the command renders them
jcogilvie Oct 21, 2026
ca7444d
refactor(diff): move the output model into a result package
jcogilvie Oct 21, 2026
ea73c40
refactor(diff): record filtered XRs in both modes; the renderer decides
jcogilvie Oct 21, 2026
b568b83
feat(simulate): map diff reports to plan.Result
jcogilvie Oct 21, 2026
7e38ef9
feat(plan): print revision impact and notes in plan text
jcogilvie Oct 21, 2026
1848412
test(simulate): drop the unused ref helper
jcogilvie Oct 21, 2026
5724b06
feat(project)!: default project simulate to -o plan
jcogilvie Oct 21, 2026
9fb0920
fix(plan): quote map keys containing dots in field paths
jcogilvie Oct 21, 2026
8d34435
fix(diff): key the function provider cache by pipeline
jcogilvie Oct 21, 2026
4eb4b72
feat(diff): let changed functions trigger composition impact analysis
jcogilvie Oct 21, 2026
f5c9b3e
feat(plan): name each composite's composition in comp results
jcogilvie Oct 21, 2026
f6e2aef
test(simulate): assert integration JSON output on plan.Result
jcogilvie Oct 21, 2026
c5d4542
refactor(simulate)!: drop crossplane-diff's v1/v2 structured output
jcogilvie Oct 21, 2026
eca9d87
feat(diff): opt-in WithKeepEqualDiffs predicate
jcogilvie Oct 21, 2026
3222868
feat(simulate): plan engine diffs with provider diff servers
jcogilvie Oct 21, 2026
1337d1b
refactor(simulate): share diff server lifecycle; load project provide…
jcogilvie Oct 21, 2026
035fad6
feat(simulate): annotate -o diff with provider plans
jcogilvie Oct 21, 2026
a3ededc
feat(project): detect changed embedded functions in project simulate
jcogilvie Oct 21, 2026
373d418
test(diff): keep engine tests free of CLI packages
jcogilvie Oct 21, 2026
7850d12
test(simulate): mark the unchanged-field check as reduced coverage
jcogilvie Oct 21, 2026
c755669
fix(simulate): tidy provider-plan review nits
jcogilvie Oct 21, 2026
a9c3223
feat(plan)!: carry before and after objects in plan.Result
jcogilvie Oct 21, 2026
0e17a0b
fix(plan): clean before and after in resource simulate
jcogilvie Oct 21, 2026
29205ff
feat(diff): opt-in per-XR timeout and after-XR hook
jcogilvie Oct 21, 2026
c32c3a4
feat(simulate): plan each composite's resources as the engine renders it
jcogilvie Oct 22, 2026
7a8b00a
feat(simulate): start provider diff servers incrementally
jcogilvie Oct 22, 2026
1f34401
feat(project): add provider plan flags to project simulate
jcogilvie Oct 22, 2026
e55788a
test(simulate): fix and tighten XRPlanner tests
jcogilvie Oct 22, 2026
add6f5d
test(simulate): stop shadowing ensureCtx in XRPlanner tests
jcogilvie Oct 22, 2026
31bf2dc
style(project): align simulate flag tags
jcogilvie Oct 22, 2026
b594f60
feat(project): plan composed resources with provider diff servers
jcogilvie Oct 22, 2026
5bb42af
feat(project): show provider plans in project simulate output
jcogilvie Oct 22, 2026
70a45a3
test(diff): run project simulate against a fake provider diff server
jcogilvie Oct 22, 2026
cc984b6
fix(project): mark replacements in project simulate -o diff
jcogilvie Oct 22, 2026
bb6a20e
docs(project): describe provider plans and exit codes in simulate help
jcogilvie Oct 22, 2026
e2e5707
perf(diff): build cluster lookups lazily instead of listing at startup
jcogilvie Oct 22, 2026
e75921a
test(diff): port lazy-lookup integration cases
jcogilvie Oct 22, 2026
e86b7cc
fix(simulate): stop mutating the global scheme in NewKubeClient
jcogilvie Oct 22, 2026
67fb727
fix(diff): pause the per-XR budget while run-wide work runs
jcogilvie Oct 22, 2026
a251772
fix(project): note when no diff server served any plan
jcogilvie Oct 22, 2026
c57d571
fix(simulate): don't cache ProviderConfig lookups that failed on a co…
jcogilvie Oct 22, 2026
3c6576a
fix(project): reject a non-positive --timeout
jcogilvie Oct 22, 2026
ddb0060
fix(simulate): degrade when a provider lookup fails in on-demand mode
jcogilvie Oct 22, 2026
a0645e7
fix(simulate): keep the first plan per diff key and document sequenti…
jcogilvie Oct 22, 2026
a5c1f7c
fix(project): allow --cache-dir with planning, select servers in a te…
jcogilvie Oct 22, 2026
e2e5a9f
fix(diff): test function start outside the XR budget, close the budge…
jcogilvie Oct 22, 2026
e9d1f3f
fix(simulate): count routed plans that fail, capitalize the warning, …
jcogilvie Oct 22, 2026
d199fcc
fix(simulate): key incremental server start by name for Development p…
jcogilvie Oct 22, 2026
9dd68d7
feat(project): accept repeated and namespace-qualified --name in proj…
jcogilvie Oct 22, 2026
c16b330
feat(diff): render pinned XRs against their revision when it calls a …
jcogilvie Oct 22, 2026
c649b23
feat(simulate): report pinned XRs rendered against their revision
jcogilvie Oct 22, 2026
4e095a3
fix(simulate): keep cluster-only changes beside a provider plan's
jcogilvie Oct 22, 2026
20e7a0f
fix(plan): tolerate empty replace paths and mark pinned composites in…
jcogilvie Oct 22, 2026
134e194
fix(simulate): cache only definite CRD answers, show provider-only re…
jcogilvie Oct 22, 2026
e31e9d9
test(simulate): cover dotted Secret keys and CRD fetch caching
jcogilvie Oct 22, 2026
99410da
feat(plan)!: always report deferred, name error refs ref, mark every …
jcogilvie Oct 22, 2026
2bc44c5
feat(plan)!: report composite reasons as a typed camelCase enum
jcogilvie Oct 22, 2026
c90f9cd
fix(diff): resolve pinned XRs on changed functions before skipping a …
jcogilvie Oct 22, 2026
5783e97
fix(diff): drop the --resource flag name from the preflight error
jcogilvie Oct 22, 2026
381a4dd
fix(load): add a loader constructor that doesn't split paths on commas
jcogilvie Oct 22, 2026
88d3b3c
fix(project): validate simulate's flags before building and keep both…
jcogilvie Oct 22, 2026
3a74587
test(diff): report parse errors from the simulate harness as main does
jcogilvie Oct 22, 2026
9c1d069
test(simulate): fail plan assertions that would pass vacuously
jcogilvie Oct 22, 2026
91d1c82
test(simulate): unify plan expectations behind one builder
jcogilvie Oct 22, 2026
681f19d
test(simulate): merge the downstream and flat resource expectations
jcogilvie Oct 22, 2026
9da35f9
test(simulate): enforce spec and absent-field checks on downstream re…
jcogilvie Oct 22, 2026
f0acbe3
test(simulate): call the unified plan expectation builder
jcogilvie Oct 22, 2026
11d5168
test(simulate): drop the pre-unification expectation names
jcogilvie Oct 22, 2026
0dec9bd
test(diff): give integration cases one plan expectation field
jcogilvie Oct 22, 2026
10faf77
test(diff): run project simulate on project fixtures
jcogilvie Oct 22, 2026
1a269d7
test(diff): simulate a project with an embedded function
jcogilvie Oct 22, 2026
5a55e75
test(project): let tests replace simulate's diff server set
jcogilvie Oct 22, 2026
afce05e
test(diff): simulate a project with a provider dependency
jcogilvie Oct 22, 2026
f919492
test(diff): prove the project's function wins over the cluster's
jcogilvie Oct 22, 2026
8bad761
test: address project table review nits
jcogilvie Oct 22, 2026
e3fc173
test(diff): drop the -short skip from project cases
jcogilvie Oct 23, 2026
61d1dd5
docs(project): fix vale errors in simulate help
jcogilvie Oct 23, 2026
572f543
docs(project): say which errors exit 1 and 80 in simulate help
jcogilvie Oct 23, 2026
8862983
style(project): realign simulate flag tags
jcogilvie Oct 23, 2026
bccaf86
Task 1: chore(lint): revert the exhaustive linter config
jcogilvie Oct 26, 2026
746e76c
Task 1: chore(lint): drop exhaustive:enforce marker
jcogilvie Oct 26, 2026
2fa2b34
Task 2: fix(project): kubeconfig namespace and the overwritten render…
jcogilvie Oct 26, 2026
8e7a879
Task 3: refactor(project): simplify simulate internals
jcogilvie Oct 26, 2026
1018446
Task 4: refactor(project): one xpkg client, one project parse, one de…
jcogilvie Oct 27, 2026
a92ea7f
Task 4: fix(project): compute embedded function digests only on request
jcogilvie Oct 27, 2026
68e6706
Task 5: refactor(project): embed render.EngineFlags; function images …
jcogilvie Oct 27, 2026
bbb88e6
Task 5: fix(project): per-command --session-id help; review fixes
jcogilvie Oct 27, 2026
27e9b2c
Task 6: refactor(project): align simulate flags with the rest of the CLI
jcogilvie Oct 27, 2026
59d8f19
Task 6: fix(project): decode only v1 Secrets from --function-credentials
jcogilvie Oct 27, 2026
bfbad20
Task 7: refactor(plan)!: restore plan.Result; add ProjectResult
jcogilvie Oct 27, 2026
f501d87
Task 7: fix(simulate): keep project JSON's summary-first key order
jcogilvie Oct 27, 2026
58aae04
Task 8: refactor(plan)!: use crossplane-runtime fieldpath for change …
jcogilvie Oct 27, 2026
7d33a93
Task 8: fix(plan): keep quoted keys verbatim in change paths
jcogilvie Oct 27, 2026
c1dded2
Task 8: docs(plan): document keys that do not round-trip through fiel…
jcogilvie Oct 27, 2026
2532026
Task 9: feat(simulate)!: one exit-code mechanism; mode-flag handling
jcogilvie Oct 27, 2026
56beb2b
Task 8: docs(plan): correct the fieldpath round-trip cases
jcogilvie Oct 27, 2026
71e0ade
Task 9: fix(simulate): exit 1 on errored plans; warn on --skip-plan f…
jcogilvie Oct 27, 2026
109880f
Task 9: docs(simulate): scope the exit-80 sentence to input-dependent…
jcogilvie Oct 27, 2026
a316635
Task 10: docs(project): one term per layer; trim help internals
jcogilvie Oct 27, 2026
7d58e92
Task 10: docs(simulate): restore the before/after contract; drop cros…
jcogilvie Oct 27, 2026
885407e
Task 11: fix(project): keep -f resources that equal a pipeline input
jcogilvie Oct 27, 2026
4d295fd
Task 12: test(project): move simulate integration tests next to the c…
jcogilvie Oct 27, 2026
25b809a
docs(simulate): address final review of round 1
jcogilvie Oct 27, 2026
ba0cc84
test(simulate): pin WithoutPipelineInputs and --providers precedence
jcogilvie Oct 27, 2026
7e54610
test(project): rewrap the localCrossplaneBinary comment
jcogilvie Oct 27, 2026
5940753
refactor(simulate): name the field manager, lease dir and XR seed cro…
jcogilvie Oct 27, 2026
99c2de2
refactor(project): load --function-credentials with render.LoadCreden…
jcogilvie Oct 27, 2026
d5539e6
fix(render): read CROSSPLANE_DOCKER_NETWORK for every render engine
jcogilvie Oct 27, 2026
bfbb5f6
test(simulate): pin the docker network default in processorOptions
jcogilvie Oct 27, 2026
06169e4
fix(diff): correct flag names in messages; reuse render's image resolver
jcogilvie Oct 27, 2026
919b66b
test(diff): update render image test comment
jcogilvie Oct 27, 2026
7dc996a
refactor(diff): check changed functions on typed pipelines
jcogilvie Oct 27, 2026
03dd388
refactor(diff): drop KeepEqualDiffs from compare.Options; delete Envi…
jcogilvie Oct 28, 2026
0a6e94b
fix(simulate): one plan per diff key; reject differing renderings
jcogilvie Oct 28, 2026
e305e6f
fix(simulate): run one render-overlap check in every mode
jcogilvie Oct 28, 2026
63897f2
fix(simulate): catch contention with unchanged renders; share managed…
jcogilvie Oct 29, 2026
7728f2a
fix(diff): word controller-ref rejection accurately; test nested XR u…
jcogilvie Oct 29, 2026
9d040f5
refactor(simulate): make diffserver.Manager.Start idempotent; drop Se…
jcogilvie Oct 29, 2026
856db05
fix(diffserver): wait for in-flight starts; skip the spinner when not…
jcogilvie Oct 29, 2026
b82c14a
fix(simulate): wait for in-flight servers on the no-spinner path
jcogilvie Oct 29, 2026
dd4628b
test(diffserver): pin the waiter retry path
jcogilvie Oct 29, 2026
6521780
refactor(simulate): one client stack and one CRD cache per run
jcogilvie Oct 29, 2026
42d563f
fix(simulate): treat only NoMatch as an unserved kind when fetching live
jcogilvie Oct 29, 2026
80d5bc6
refactor(simulate): remove duplicated helpers
jcogilvie Oct 29, 2026
34b4924
test(plan): cover whole-field Secret redaction; move status list
jcogilvie Oct 29, 2026
edb1097
refactor(simulate): place -o diff markers by yaml.v3 node positions
jcogilvie Oct 29, 2026
1073b29
fix(simulate): keep marker lines aligned across YAML line breaks
jcogilvie Oct 30, 2026
7b61169
fix(simulate): mask sensitive lines on sides that don't parse
jcogilvie Oct 30, 2026
b913510
fix(simulate): redact whole sensitive subtrees and every keyed match
jcogilvie Oct 30, 2026
89b3b3e
fix(simulate): fuzz -o diff redaction; cover keyed moves and flow values
jcogilvie Oct 30, 2026
e4bb56e
style(simulate): keep the line-break replacer local
jcogilvie Oct 30, 2026
68e304d
test(simulate): give lineDiff Clean views as GenerateDiff does
jcogilvie Oct 30, 2026
9aa40c9
feat(plan): redact sensitive paths on object copies
jcogilvie Oct 30, 2026
bcd281d
fix(simulate): redact -o diff before diffing
jcogilvie Oct 30, 2026
4b6fc25
fix(plan): fail closed on wrong-shape and ambiguous sensitive paths
jcogilvie Oct 31, 2026
d3434bd
fix(plan): redact every list item for an index path
jcogilvie Oct 31, 2026
0699934
fix(simulate): keep a hidden diff body in compact mode
jcogilvie Oct 31, 2026
f4c73ad
test(simulate): pin redaction scenarios at render level
jcogilvie Oct 31, 2026
50ff9a5
fix(plan): fail closed on a map key holding brackets
jcogilvie Oct 31, 2026
1c83121
test(simulate): assert hidden or redacted per leak case
jcogilvie Oct 31, 2026
8fbc8af
refactor(simulate): place "(known after apply)" in the object
jcogilvie Oct 31, 2026
1699ccf
refactor(simulate): import the packages moved to pkg/
jcogilvie Oct 31, 2026
8a3391c
refactor(simulate): locate "# forces replacement" by a marshal probe
jcogilvie Oct 31, 2026
7bb08d6
fix(simulate): redact Secret data in -o diff
jcogilvie Oct 31, 2026
b971988
fix(plan): build Secret key paths from segments
jcogilvie Oct 31, 2026
faa004b
fix(simulate): mark a shared replacement line once
jcogilvie Oct 31, 2026
b691b7b
fix(simulate): fail closed on removed and view-less Secret diffs
jcogilvie Oct 31, 2026
a533747
style(simulate): format the new annotate test cases
jcogilvie Oct 31, 2026
d94960e
refactor(simulate): move the project simulate runner into internal/si…
jcogilvie Oct 31, 2026
4666486
refactor(simulate): make project simulate take only a project file
jcogilvie Oct 31, 2026
237b008
revert(load): drop the exact composite loader
jcogilvie Oct 31, 2026
3bae370
style(simulate): satisfy lint after the project-file flag
jcogilvie Oct 31, 2026
b975f1e
refactor(diff): remove the XR-only diff path
jcogilvie Oct 31, 2026
386ba63
test(simulate): cut the integration suite to project mode
jcogilvie Oct 31, 2026
a4fca32
test(diff): remove unused test helpers
jcogilvie Oct 31, 2026
0009cce
docs(simulate): describe project-only simulate
jcogilvie Oct 31, 2026
44a3138
docs(simulate): describe the three simulate commands in the one-pager
jcogilvie Oct 31, 2026
685c426
refactor(simulate): move the selection flags into CompositionFlags
jcogilvie Nov 1, 2026
3c37275
test(diff): table-test managedBy and boundToClaim
jcogilvie Nov 1, 2026
64e63dd
refactor(simulate): remove the unused ExitCodeUsage
jcogilvie Nov 1, 2026
c7207e8
test(simulate): run the integration harness on internal/testutils/int…
jcogilvie Nov 3, 2026
0826ace
test(diff): delete testutils' copies of the integration package helpers
jcogilvie Nov 3, 2026
694244e
docs(diff): drop leftover upstream wording
jcogilvie Nov 4, 2026
d252cde
refactor(diff): rename input_validator.go to overlap.go
jcogilvie Nov 4, 2026
ce3f3bb
refactor(diff): remove unused processor options and client methods
jcogilvie Nov 4, 2026
c67ed02
refactor(diff): drop render_engine race note and unused output formats
jcogilvie Nov 4, 2026
92443ca
refactor(diff): delete unused mock builder setters
jcogilvie Nov 4, 2026
2478c61
refactor(render): leave resolveProjectFile where it was on main
jcogilvie Nov 4, 2026
34cc834
fix(diff): fail a composition when default discovery errors other tha…
jcogilvie Nov 4, 2026
f7482bb
fix(diff): fail default discovery when listing XRs or claims errors
jcogilvie Nov 4, 2026
b71d8e0
fix(diff): a failed pinned-revision lookup no longer raises the analy…
jcogilvie Nov 4, 2026
5216645
fix(diff): break renderDiffList sort ties on the diff key
jcogilvie Nov 4, 2026
eb2c7b0
docs(diff): track the deferred pinned claim as a TODO
jcogilvie Nov 4, 2026
64e2011
refactor(diff): remove the grouped renderer and NameGenerated
jcogilvie Nov 4, 2026
9cab622
refactor(diff): look up GVRs and scopes through the cached RESTMapper
jcogilvie Nov 4, 2026
131e1ad
fix(simulate): wrap the unwrapped errors in the simulate commands
jcogilvie Nov 4, 2026
b56c8c0
refactor(diff): share one server-managed metadata list and drop compa…
jcogilvie Nov 4, 2026
b94c391
refactor(plan): move the path redaction into internal/simulate
jcogilvie Nov 4, 2026
cff8262
fix(plan): redact sensitive paths in before and after, and default Af…
jcogilvie Nov 4, 2026
aecdda1
refactor(simulate): load function credentials in Run and tidy the fla…
jcogilvie Nov 4, 2026
4b6aa6a
refactor(project): return the embedded function digests from Build
jcogilvie Nov 4, 2026
6d96e5e
docs(simulate): bring the one-pager's flag sketch up to date
jcogilvie Nov 4, 2026
14b18d8
test(project): unit-test the project fixtures that fail before the cl…
jcogilvie Nov 4, 2026
4d01cc5
refactor(simulate): share the usage exit code between main and the tests
jcogilvie Nov 4, 2026
b1d4e55
test(project): inline runSimulateArgvRouted and fix the harness comments
jcogilvie Nov 4, 2026
0d8e694
test(project): drop the concurrent diff test, its helpers and fixtures
jcogilvie Nov 4, 2026
fafedc1
test(diff): delete SetupKubeTestLogger
jcogilvie Nov 4, 2026
4b73fdc
test(project): assert on project simulate's result, not the simtest DSL
jcogilvie Nov 4, 2026
a734b0b
test(project): preallocate the composite results
jcogilvie Nov 4, 2026
46f18ba
refactor(simulate): drop the XR report path until xr simulate needs it
jcogilvie Nov 4, 2026
0c06ac7
docs(diff): reword comments carried over from crossplane-diff
jcogilvie Nov 4, 2026
8f60016
refactor(simulate): render through render.Session; remove dockerrun
jcogilvie Nov 6, 2026
b5d46ec
refactor(project): use name.Digest for embedded function digests
jcogilvie Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Zone.Identifier
build/

# Nix build output symlinks
result
result-*
/result
/result-*

# Exclude the ko data dir
kodata/
Expand Down Expand Up @@ -48,3 +48,4 @@ AGENTS.md

# Integration test coverage (nix run .#integration-test)
/coverage-integration.txt
/coverage-merged.txt
6 changes: 1 addition & 5 deletions cmd/crossplane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func main() {
flagVal, err := configFlag(os.Args[1:])
if err != nil {
fmt.Fprintf(os.Stderr, "crossplane: %v\n", err)
os.Exit(exitUsageError)
os.Exit(isimulate.ExitCodeUsage)
}
cfgPath := config.ResolvePath(flagVal)

Expand Down Expand Up @@ -210,10 +210,6 @@ func exitOnSignal(tty bool) {
os.Exit(130)
}

// exitUsageError is the status kong exits with on a parse error. Kong does
// not export it, so it is mirrored here for flag errors found before Parse.
const exitUsageError = 80

// configFlag scans argv for the --config flag and returns its value or "" if
// the config flag is not present.
func configFlag(args []string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/crossplane/project/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (c *buildCmd) Run(logger logging.Logger, sp terminal.SpinnerPrinter, cfg *c
var imgMap project.ImageTagMap
err = sp.WrapAsyncWithSuccessSpinners(func(ch async.EventChannel) error {
var buildErr error
imgMap, buildErr = b.Build(ctx, c.proj, c.projFS,
imgMap, _, buildErr = b.Build(ctx, c.proj, c.projFS,
project.BuildWithLogger(logger),
project.BuildWithEventChannel(ch),
)
Expand Down
44 changes: 44 additions & 0 deletions cmd/crossplane/project/help/simulate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
The `project simulate` command previews how applying a project's Compositions
would change the composite resources in a cluster. It renders each affected
composite resource and shows the difference from what's in the cluster. It
doesn't change the cluster.

The `-f` flag names the project file, `crossplane-project.yaml` by default. The
command builds the project's embedded functions and loads them into the local
Docker daemon, resolves its function dependencies, and collects the
Compositions under its APIs path. It renders each composite resource that uses
one of those Compositions with the project's version of the Composition, using
the project's functions in place of the cluster's functions of the same name.
`--max-concurrency` caps the concurrent function builds, and `--cache-dir` sets
where package contents are cached.

The command connects to the cluster in your current Kubernetes context, or the
one `--context` names.

The command needs Docker, to build and run functions, and read access to the
cluster's Crossplane resources. It verifies the rendered resources with
server-side dry-run requests, so it also needs the `create` and `patch` verbs on
them. Use `--as`, `--as-group`, and `--as-uid` to simulate as another user.

For example, a run with `--skip-plan` whose project changes a Composition
prints a plan like this:

```
[~] Composition.apiextensions.crossplane.io xnetworks.example.org (update)
Applying this creates a new CompositionRevision, which 1 composite would adopt.
spec:
pipeline[0]:
input:
~ region: "us-west-1" -> "us-east-1"

XR: XNetwork.example.org team-a/prod-network
[~] VPC.ec2.aws.upbound.io prod-network (update)
spec:
forProvider:
~ region: "us-west-1" -> "us-east-1"

Plan: 0 to add, 2 to change, 0 to destroy.

Note: Provider plan skipped (--skip-plan).
```

45 changes: 45 additions & 0 deletions cmd/crossplane/project/help/simulate_examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

## Examples

Simulate the project in the current directory against the current context:

```shell
crossplane project simulate
```

Simulate the project in another directory:

```shell
crossplane project simulate -f path/to/crossplane-project.yaml
```

Simulate against another context, only for composite resources in one
namespace:

```shell
crossplane project simulate --context=staging -n team-a
```

Simulate a single namespaced composite resource:

```shell
crossplane project simulate -n team-a --name=my-database
```

Simulate two composite resources in different namespaces:

```shell
crossplane project simulate --name=team-a/my-database --name=team-b/my-database
```

Print the plan as JSON:

```shell
crossplane project simulate -o json
```

Print a line diff of each changed resource:

```shell
crossplane project simulate -o diff
```
23 changes: 23 additions & 0 deletions cmd/crossplane/project/integration_main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//go:build integration

package project

import (
"fmt"
"os"
"testing"

"github.com/crossplane/cli/v2/internal/testutils/integration"
)

// TestMain runs before all tests.
func TestMain(m *testing.M) {
// Kill envtest servers that an earlier run left behind when it died abnormally.
integration.ReapOrphanedEnvtest(func(format string, args ...any) { fmt.Fprintf(os.Stderr, format+"\n", args...) })

// Run all tests
exitCode := m.Run()

// Exit with the test suite's exit code
os.Exit(exitCode)
}
Loading
Loading