Expand description
caproni run: run reloaders in edit mode until interrupted.
Port of Go’s cmd/run package.
runRun’s setup pipeline (repository cloning, cluster DNS domain
resolution) and its concurrent core (runAndWait: one goroutine per
reloader, signal handling) are both ported for real below. The
concurrent core uses [tokio::task::JoinSet] for structured
concurrency – see execute_reloaders_concurrently’s doc comment
for the full design and what’s intentionally out of scope (the TUI,
mirror deployment-copy orchestration). See
PORT_NOTES.md’s “fifth pass” entry for the complete rationale.
Structs§
Enums§
- RunError
- Port of
run.ErrNoEditModeReloaders/run.ErrRepositoryNotDefined.
Functions§
- build_
reloader_ run_ fn - Production
ReloaderRunFn: dispatches to the concretemirror/skaffoldreloader manager forreloader_config.reloader_type, running it (via [tokio::task::spawn_blocking], since both managers’runblocks synchronously until their subprocess exits) against a freshkubectl::Clientbuilt from the cluster’s kubeconfig. - collect_
mirror_ namespaces - Port of
collectMirrorNamespaces: the deduplicated set of target namespaces from allmirrorreloaders, in first-seen order. - collect_
reloader_ errors - Port of
collectReloaderErrors: filters out cancellation errors (expected during graceful shutdown) and returns any real failures. - execute_
reloaders_ concurrently - Port of
runAndWait’s concurrent core: launches every edit-mode reloader’srun_oneconcurrently, waits for all of them to finish (whether they succeed, fail, or a shutdown signal arrives first), and collects any real failures. - find_
edit_ mode_ reloaders - Port of
findEditModeReloaders: returns every reloader withedit_mode: true. - has_
repository_ active_ reloader - Port of
hasRepositoryActiveReloader: whether any edit-mode reloader uses the given repository. - reloader_
names - Port of
reloaderNames: the sorted names of a reloader map, for deterministic logging. - run
- run_run
- Port of
run.runRun: loads the configuration, findsedit_modereloaders, clones their repositories, resolves the cluster’s DNS domain, fetches its kubeconfig, runsedit_mode_startlifecycle hooks, launches every reloader concurrently viaexecute_reloaders_concurrently, then runsedit_mode_stoplifecycle hooks.
Type Aliases§
- Reloader
Future - A single reloader’s execution, as an owned, boxed future. Production
implementations wrap a blocking call (mirror/skaffold’s
run) in [tokio::task::spawn_blocking]; test doubles can be a plainasyncblock. - Reloader
RunFn - Runs one reloader by name, returning its outcome. Mirrors Go’s
runReloader/runWithHooksfolded into a single injected function, the same DI patternup/ca/deploy/run’s setup pipeline already use for theirKubectlFactory/Connector/git::Backendparameters. - RunOne
Builder - Builds the
ReloaderRunFnrun_runhands toexecute_reloaders_concurrently, given the resolved configuration, cluster kubeconfig, and (if the log-filter TUI is active) thetracing::Dispatcheach reloader task should log through for the duration of its own work. Injected (rather than hard-coded insiderun_run) so tests can substitute a fake, instantly-resolvingReloaderRunFnwithout a live cluster, realmirrord/skaffoldbinaries, or real subprocess execution – exactly like every other injected seam in this crate (see the module doc comment).