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

Function docker_pull_progress_event

crates/openshell-driver-docker/src/lib.rs:1631–1657  ·  view source on GitHub ↗
(image: &str, info: &CreateImageInfo)

Source from the content-addressed store, hash-verified

1629}
1630
1631fn docker_pull_progress_event(image: &str, info: &CreateImageInfo) -> Option<DriverPlatformEvent> {
1632 let status = info.status.as_deref().map(str::trim)?;
1633 if status.is_empty() {
1634 return None;
1635 }
1636
1637 let mut metadata = HashMap::from([
1638 ("image_ref".to_string(), image.to_string()),
1639 ("docker_status".to_string(), status.to_string()),
1640 ]);
1641 if let Some(layer_id) = info.id.as_deref().filter(|id| !id.is_empty()) {
1642 metadata.insert("layer_id".to_string(), layer_id.to_string());
1643 }
1644 if let Some(detail) = docker_pull_progress_detail(info) {
1645 metadata.insert("detail".to_string(), detail);
1646 }
1647 attach_docker_progress_metadata(&mut metadata, "PullingLayer", status);
1648
1649 Some(DriverPlatformEvent {
1650 timestamp_ms: openshell_core::time::now_ms(),
1651 source: "docker".to_string(),
1652 r#type: "Normal".to_string(),
1653 reason: "PullingLayer".to_string(),
1654 message: docker_pull_message(info, status),
1655 metadata,
1656 })
1657}
1658
1659fn docker_pull_message(info: &CreateImageInfo, status: &str) -> String {
1660 info.id.as_deref().filter(|id| !id.is_empty()).map_or_else(

Calls 5

now_msFunction · 0.85
docker_pull_messageFunction · 0.85
is_emptyMethod · 0.45