Repository navigation
refactor(simulate): move resource simulate's planning and diff server lifecycle into internal/simulate - #479
Merged
jcogilvie merged 1 commit intoOct 30, 2026
Conversation
… lifecycle into internal/simulate Pure move with no behaviour change. The per-resource planner, provider discovery, provider-input and image-config loading, diff server start and stop, and CRD defaulting move from cmd/crossplane/simulate into internal/simulate. The kubeconfig loading moves into kube.RESTConfig. The tests move along with the code. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
This was referenced Oct 30, 2026
jcogilvie
marked this pull request as ready for review
October 30, 2026 18:32
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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 |
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Summary
A pure code move with no behaviour change.
crossplane resource simulatekeeps the same output, flags, help and exit codes.Why
project simulate(#436) needs the same diff server lifecycle, per-resource planning and kubeconfig handling. If the code moves into shared packages first, #436's diff for these files shows only its new behaviour, not about 1.2k lines of moved code.What changed
internal/simulate/simulate.go:Router,Planner/NewPlanner/Plan(this wasCmd.simulateOne; the object store and CRD defaults caches now live inside the Planner),fetchLive, the object store cache,providerConfigMapping,RelevantProviderImages.internal/simulate/servers.go: the runtime annotation constants,EnsureServers/StopServers(the start-behind-spinner, skipped-report and cleanup code fromRun),ImageConfigs,NeedsDocker,LoadProviderInputs,LoadImageConfigs.internal/simulate/defaults.go: moved withgit mv, unchanged.internal/kube/config.go:RESTConfig, the kubeconfig, impersonation and QPS/Burst setup fromsetupKubeClient, with a new unit test.cmd/crossplane/simulate/simulate.gokeeps only the command: flags, help,AfterApply,Runand the client and REST mapper setup.internal/simulate/{simulate,servers}_test.go. The assertions are unchanged; they now call the exported names, andTestSimulateOneis nowTestPlanner.Testing
./nix.sh run .#testand./nix.sh run .#lintpass.resource simulate --helpand the error output for a missing-ffile are byte-identical to main's.Related
resource simulate'sRun, so whichever merges second has a small conflict.I have:
./nix.sh flake checkto ensure this PR is ready for review. (./nix.sh run .#testand./nix.sh run .#lintpass.)Linked a PR or a docs tracking issue to document this change.(pure move, no user-facing change)Addedbackport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.
🤖 Generated with Claude Code