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

Function validated_container_name

crates/openshell-driver-podman/src/driver.rs:69–74  ·  view source on GitHub ↗

Construct and validate a container name from a sandbox name. Combines the prefix with the sandbox name and validates the result against Podman's naming rules before any resources are created.

(sandbox_name: &str)

Source from the content-addressed store, hash-verified

67/// Combines the prefix with the sandbox name and validates the result
68/// against Podman's naming rules before any resources are created.
69fn validated_container_name(sandbox_name: &str) -> Result<String, ComputeDriverError> {
70 let name = container::container_name(sandbox_name);
71 crate::client::validate_name(&name)
72 .map_err(|e| ComputeDriverError::Precondition(e.to_string()))?;
73 Ok(name)
74}
75
76fn podman_volume_is_bind_backed(volume: &VolumeInspect) -> bool {
77 (volume.driver.is_empty() || volume.driver == "local")

Callers 3

create_sandboxMethod · 0.85
stop_sandboxMethod · 0.85
delete_sandboxMethod · 0.85

Calls 2

container_nameFunction · 0.85
validate_nameFunction · 0.85

Tested by

no test coverage detected