(image_ref: &str)
| 3479 | } |
| 3480 | |
| 3481 | fn image_reference_registry_host(image_ref: &str) -> &str { |
| 3482 | let mut parts = image_ref.splitn(2, '/'); |
| 3483 | let first = parts.next().unwrap_or(image_ref); |
| 3484 | let has_path = parts.next().is_some(); |
| 3485 | if has_path |
| 3486 | && (first.contains('.') || first.contains(':') || first.eq_ignore_ascii_case("localhost")) |
| 3487 | { |
| 3488 | first |
| 3489 | } else { |
| 3490 | "docker.io" |
| 3491 | } |
| 3492 | } |
| 3493 | |
| 3494 | impl VmDriver { |
| 3495 | #[allow(clippy::too_many_arguments)] |