Merge pull request #6117 from stevenhorsman/image-pull-logs

agent: Improve logging of pull image
This commit is contained in:
Steve Horsman 2023-01-24 08:53:37 +00:00 committed by GitHub
commit 49b89c915c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,16 +295,33 @@ impl ImageService {
info!(sl!(), "pull image {:?}, bundle path {:?}", cid, bundle_path); info!(sl!(), "pull image {:?}, bundle path {:?}", cid, bundle_path);
// Image layers will store at KATA_CC_IMAGE_WORK_DIR, generated bundles // Image layers will store at KATA_CC_IMAGE_WORK_DIR, generated bundles
// with rootfs and config.json will store under CONTAINER_BASE/cid. // with rootfs and config.json will store under CONTAINER_BASE/cid.
self.image_client let res = self
.image_client
.lock() .lock()
.await .await
.pull_image(image, &bundle_path, &source_creds, &Some(&decrypt_config)) .pull_image(image, &bundle_path, &source_creds, &Some(&decrypt_config))
.await?; .await;
info!( match res {
sl!(), Ok(image) => {
"pull and unpack image {:?}, with image-rs succeeded ", cid info!(
); sl!(),
"pull and unpack image {:?}, cid: {:?}, with image-rs succeed. ",
image,
cid
);
}
Err(e) => {
error!(
sl!(),
"pull and unpack image {:?}, cid: {:?}, with image-rs failed with {:?}. ",
image,
cid,
e.to_string()
);
return Err(e);
}
};
} }
let mut sandbox = self.sandbox.lock().await; let mut sandbox = self.sandbox.lock().await;