feat(simulate-e2e-fixes): full operator simulation — hooks, constructors, cross:, multi-CRD, e2e.yaml, discovery#161
Merged
Merged
Conversation
…s constructor simulation
…constructors run in custom binary
…ing, partial-block notes
…ainst actual directory structure
…tructors, aggregator, limitations
…oves *event.Event dependency from constructor boundary
…rder — GenericReconciler nil-coalesces to internal discardRecorder
…same fix as crdFile
… ./... --skip pattern
…entf calls for nil simulation case
… nil guard pattern
…— external: calls hit real network by default, stub with flag
…il — no nil guards needed; update docs and examples
…gets its own CR by kind; unblocks multi-CRD katalogs and cross: patterns and examples cleanup
…ycle numbers; Result.AllOps carries full op list for diagnostics
…ycle numbers; Result.AllOps carries full op list for diagnostics
…g CRs into fake informers; RunOptions.Peers wires them into katalogRegistry
…s from typeregistry init() before CLI flag parsing
…ped indexer, cross: wiring, hooks, event.Discard, RunOptions, AllOps
… read local paths; add crd-worker.yaml to setup.apply in motif-composition e2e
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.
Summary
Interface changes
pkg/types/func.go+pkg/generate/registry_template.go:NewReconcilerFuncacceptsevent.Recorderinterface +kubeclient.KubeClientpkg/event/noop.godeleted;Recorderinterface inevent.go;event.Discard()added;GenericReconcilernil-coalesces via privatediscardRecorderSimulate engine (
pkg/simulate/harness.go)BindToObjectHookspanicsHookRegistry[gvk]andReconcilerRegistry[gvk]wired at runtime — custom binary runs real hooks and constructors against fake clusterRunOptions.SkipExternal— noopTransport is opt-in; default hits real networkRunOptions.Peers+*kordinator.ResourceKatalog— sibling CRs seeded into fake informers;cross:observation works when peer CRs are in the CR fileResult.AllOps— all ops across all cycles, for--debug-opsdiagnosticsCLI (
cmd/cli/simulate.go)e2e.yamlas-finput; expands aggregators recursively; skipscustomOperator: true./...discovery with per-file results, aggregate summary, exit code 1 on cycle errors--skip— exclude path patterns from./...discovery--skip-external— stubexternal:HTTP calls--debug-ops— print all recorded ops with cycle numbers (diagnostic)kind; CRDs without a matching CR skipped with a notecross:works in both direct and discovery modeFixes
pkg/merger/helper.go:isFileMotif()— motif import paths absolutized relative to katalog dirpkg/katalog/parser.go:CRDFilecleared afterpopulateAPITypesFromCRDFile— runtime pod no longer tries to read local filesystem paths from the bundle ConfigMapexamples/use-cases/external/10-motif-composition/e2e.yaml:crd-worker.yamladded tosetup.applypkg/logger/logger.go: default levelInfoLevel— suppresses typeregistry debug logs before CLI flag parsingCHANGELOG.md+charts/orkestra/Chart.yaml: bumped to v0.7.1Examples + docs
evtype →event.Recorder; nil guards removed (Discard() used instead)documentation/concepts/simulate/: five new concept pages;02-running.mdand05-limitations.mdupdated for all new flags andcross:statuspkg/simulate/README.md+docs/03-limitations.md+docs/04-internals.mdrewrittenTest plan
ork simulate -f e2e.yamlfrom subdirectory — katalog and CR resolved correctlyork simulate ./...— all e2e.yaml files discovered, file paths correctork simulate ./...with cycle errors — exit 1, hint with exact commandsork simulate ./... --skip cr-e2e.yaml— matching files excludedork simulate -f e2e.yaml --skip-external— external: note says "stubbed"ork simulate -f external/e2e.yaml— motif paths resolved, no "no such file" errorork simulate -f full-stack-app/03-cross-crd/e2e.yaml— managed-database simulated, database-backed-app skippedork simulate -f multi-tenancy/01-basic-namespacing/e2e.yaml— Database and Website both simulate from multi-doc cr.yamlork simulate --cr cr.yamlfrom09-hookscustom binary — StatefulSet/Service/CronJob created in cycle 1ork simulate --cr cr.yamlfrom10-constructorcustom binary — Job created in cycle 1ork simulate --debug-ops— all ops printed with cycle numbersork simulate -f cross-crd/e2e.yamlwith multi-doc CR containing both CRDs — cross.* fields populatedork e2e -f external/10-motif-composition/e2e.yaml --use-current --dev-server— 4 of 4 pass; runtime pod starts without crdFile path error