diff options
Diffstat (limited to 'src/pipeline/mod.rs')
| -rw-r--r-- | src/pipeline/mod.rs | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index 350df0c..6729605 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -171,36 +171,10 @@ impl Ctx { log: cfg.build_log_path(build_id), profile, attempt, - backend: Self::backend_for(cfg)?, + backend: crate::sandbox::backend_for(cfg)?, }) } - /// Which backend a build runs on is configuration, not code: the step - /// machine cannot tell loopback from remote, which is the seam's whole - /// point. `remote` binds the agent listener for the lifetime of this - /// run's context. - fn backend_for(cfg: &Config) -> Result<Arc<dyn SandboxBackend>> { - // The startup guard in the CLI catches this first; repeating it here is - // what makes "the config was never validated" impossible for anything - // that constructs a backend — a test, a future daemon, a tool. - cfg.validate()?; - match &cfg.sandbox { - crate::config::Sandbox::Loopback => { - Ok(Arc::new(crate::sandbox::loopback::LoopbackBackend::new(cfg))) - } - crate::config::Sandbox::Remote { listen, token, .. } => Ok(Arc::new( - crate::sandbox::remote::RemoteBackend::bind(cfg, listen, token)?, - )), - // A valid kind that is not wired up yet is an error, never a - // fallthrough: a build configured for a Kata VM that silently ran - // as the hub's own user is the failure this enum was added to stop. - crate::config::Sandbox::AgentSandbox { .. } => Err(Error::invalid(concat!( - "sandbox kind \"agent-sandbox\" is not wired up yet; refusing to run this build ", - "on a backend it was not configured for", - ))), - } - } - /// Lease a sandbox for this build's profile. Today every step acquires and /// releases around itself; a remote backend will hold one sandbox across /// the sandbox-bearing steps of a build, and steps stay idempotent either |
