mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-21 09:25:19 +00:00
agent: Improve logging of pull image
- Add agent log if pull image fails Fixes: #6118 Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
parent
b91337afef
commit
0fc7b4b74d
@ -295,17 +295,34 @@ 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;
|
||||||
|
|
||||||
|
match res {
|
||||||
|
Ok(image) => {
|
||||||
info!(
|
info!(
|
||||||
sl!(),
|
sl!(),
|
||||||
"pull and unpack image {:?}, with image-rs succeeded ", cid
|
"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;
|
||||||
sandbox.images.insert(String::from(image), cid);
|
sandbox.images.insert(String::from(image), cid);
|
||||||
|
Loading…
Reference in New Issue
Block a user