feat(vm): add openshell-vm crate with libkrun microVM gateway (#611)

This commit is contained in:
Drew Newberry
2026-04-08 22:00:01 -07:00
committed by GitHub
parent c2e5256725
commit ddb85b1704
56 changed files with 10972 additions and 61 deletions
+5 -1
View File
@@ -62,9 +62,13 @@ fn resolve_gateway(
gateway_endpoint: &Option<String>,
) -> Result<GatewayContext> {
if let Some(endpoint) = gateway_endpoint {
// When a gateway name is explicitly provided (via flag or env var),
// trust it directly — don't require metadata to exist yet. This
// avoids a race condition where mTLS certs are stored under the
// real gateway name but the CLI falls back to using the raw
// endpoint URL (producing a mangled path like `https___...`).
let name = gateway_flag
.clone()
.filter(|name| get_gateway_metadata(name).is_some())
.or_else(|| find_gateway_by_endpoint(endpoint))
.unwrap_or_else(|| endpoint.clone());
return Ok(GatewayContext {
+6 -1
View File
@@ -2118,7 +2118,12 @@ pub async fn sandbox_create(
// Track whether we have seen a non-Ready phase during the watch.
let mut saw_non_ready = SandboxPhase::try_from(sandbox.phase) != Ok(SandboxPhase::Ready);
let start_time = Instant::now();
let provision_timeout = Duration::from_secs(300);
let provision_timeout = Duration::from_secs(
std::env::var("OPENSHELL_PROVISION_TIMEOUT")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(300),
);
// Track whether we saw the gateway become ready (from log messages).
let mut saw_gateway_ready = false;