(manifests: &[ImageIndexEntry])
| 3420 | } |
| 3421 | |
| 3422 | fn 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 | |
| 3440 | fn linux_oci_arch() -> &'static str { |
| 3441 | match std::env::consts::ARCH { |
nothing calls this directly
no test coverage detected