Skip to content

Commit 8029321

Browse files
authored
fix(sdk): initialize sandbox annotations (#2296)
The SDK merged after CreateSandboxRequest and ObjectMeta gained annotations on main, leaving stale struct initializers that prevented the crate and its tests from compiling. Initialize the curated request and mock metadata with empty annotation maps. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent e6f319c commit 8029321

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎crates/openshell-sdk/src/client.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use crate::types::{
1919
};
2020
use futures::StreamExt;
2121
use openshell_core::proto;
22+
use std::collections::HashMap;
2223
use std::future::Future;
2324
use std::sync::Arc;
2425
use std::time::{Duration, Instant};
@@ -468,6 +469,7 @@ fn create_sandbox_request(spec: SandboxSpec) -> proto::CreateSandboxRequest {
468469
}),
469470
name: name.unwrap_or_default(),
470471
labels,
472+
annotations: HashMap::new(),
471473
}
472474
}
473475

‎crates/openshell-sdk/tests/client_mock.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fn sandbox_with_phase(name: &str, phase: proto::SandboxPhase) -> proto::Sandbox
5555
created_at_ms: 0,
5656
labels: HashMap::new(),
5757
resource_version: 1,
58+
annotations: HashMap::new(),
5859
}),
5960
spec: None,
6061
status: Some(proto::SandboxStatus {
@@ -623,6 +624,7 @@ async fn create_sandbox_passes_spec_through() {
623624
let observed = state.last_create.lock().await.clone().unwrap();
624625
assert_eq!(observed.name, "my-box");
625626
assert_eq!(observed.labels, labels);
627+
assert!(observed.annotations.is_empty());
626628
let observed_spec = observed.spec.unwrap();
627629
assert!(
628630
observed_spec

0 commit comments

Comments
 (0)