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

Function linux_platform_resolver

crates/openshell-driver-vm/src/driver.rs:3422–3438  ·  view source on GitHub ↗
(manifests: &[ImageIndexEntry])

Source from the content-addressed store, hash-verified

3420}
3421
3422fn linux_platform_resolver(manifests: &[ImageIndexEntry]) -> Option<String> {
3423 let expected_arch = linux_oci_arch();
3424 manifests
3425 .iter()
3426 .find_map(|entry| {
3427 let platform = entry.platform.as_ref()?;
3428 (platform.os.to_string() == "linux"
3429 && platform.architecture.to_string() == expected_arch)
3430 .then(|| entry.digest.clone())
3431 })
3432 .or_else(|| {
3433 manifests.iter().find_map(|entry| {
3434 let platform = entry.platform.as_ref()?;
3435 (platform.os.to_string() == "linux").then(|| entry.digest.clone())
3436 })
3437 })
3438}
3439
3440fn linux_oci_arch() -> &'static str {
3441 match std::env::consts::ARCH {

Callers

nothing calls this directly

Calls 1

linux_oci_archFunction · 0.85

Tested by

no test coverage detected