mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-19 05:50:41 +08:00
feat(vm): add openshell-vm crate with libkrun microVM gateway (#611)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user