MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / wait_for_sandbox

Function wait_for_sandbox

e2e/rust/tests/user_namespaces.rs:83–97  ·  view source on GitHub ↗
(name: &str, timeout_secs: u64)

Source from the content-addressed store, hash-verified

81}
82
83async fn wait_for_sandbox(name: &str, timeout_secs: u64) -> Result<(), String> {
84 let deadline = tokio::time::Instant::now() + Duration::from_secs(timeout_secs);
85 while tokio::time::Instant::now() < deadline {
86 if let Ok(n) = kubectl(&[
87 "get", "sandbox", name, "-n", "openshell",
88 "-o", "jsonpath={.metadata.name}",
89 ]).await {
90 if !n.trim().is_empty() {
91 return Ok(());
92 }
93 }
94 tokio::time::sleep(Duration::from_secs(2)).await;
95 }
96 Err(format!("sandbox {name} did not appear within {timeout_secs}s"))
97}
98
99/// Find a sandbox pod by its sandbox CRD name. The CRD controller creates a
100/// pod with the same name as the Sandbox resource.

Calls 2

kubectlFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected