Skip to content

Commit dc44ee5

Browse files
drewlinuxdevel
authored andcommitted
refactor(sandbox): remove unused pod_template field from CreateSandbox RPC (NVIDIA#522)
1 parent 3e2f211 commit dc44ee5

File tree

5 files changed

+6
-329
lines changed

5 files changed

+6
-329
lines changed

architecture/sandbox-custom-containers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The server applies these transforms to every sandbox pod template (`sandbox/mod.
6767
3. Overrides the agent container's `command` to `/opt/openshell/bin/openshell-sandbox`.
6868
4. Sets `runAsUser: 0` so the supervisor has root privileges for namespace creation, proxy setup, and Landlock/seccomp.
6969

70-
These transforms apply to both generated templates and user-provided `pod_template` overrides.
70+
These transforms apply to every generated pod template.
7171

7272
## CLI Usage
7373

crates/openshell-core/src/proto/openshell.datamodel.v1.rs

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/openshell-server/src/grpc.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const MAX_TEMPLATE_STRING_LEN: usize = 1024;
9292
/// Maximum number of entries in template map fields (`labels`, `annotations`, `environment`).
9393
const MAX_TEMPLATE_MAP_ENTRIES: usize = 128;
9494

95-
/// Maximum serialized size (bytes) for template Struct fields (`resources`, `pod_template`,
95+
/// Maximum serialized size (bytes) for template Struct fields (`resources`,
9696
/// `volume_claim_templates`).
9797
const MAX_TEMPLATE_STRUCT_SIZE: usize = 65_536;
9898

@@ -3161,14 +3161,6 @@ fn validate_sandbox_template(tmpl: &SandboxTemplate) -> Result<(), Status> {
31613161
)));
31623162
}
31633163
}
3164-
if let Some(ref s) = tmpl.pod_template {
3165-
let size = s.encoded_len();
3166-
if size > MAX_TEMPLATE_STRUCT_SIZE {
3167-
return Err(Status::invalid_argument(format!(
3168-
"template.pod_template serialized size exceeds maximum ({size} > {MAX_TEMPLATE_STRUCT_SIZE})"
3169-
)));
3170-
}
3171-
}
31723164
if let Some(ref s) = tmpl.volume_claim_templates {
31733165
let size = s.encoded_len();
31743166
if size > MAX_TEMPLATE_STRUCT_SIZE {

0 commit comments

Comments
 (0)