Merge pull request #8400 from littlejawa/fix_pullimage_in_guest_for_crio

CC | agent: fix annotation name to allow cri-o support of CoCo pullimage in guest
This commit is contained in:
Steve Horsman
2023-11-08 18:55:47 +00:00
committed by GitHub

View File

@@ -207,7 +207,16 @@ impl ImageService {
) -> Result<String> {
info!(sl(), "image metadata: {:?}", image_metadata);
Self::set_proxy_env_vars();
if image_metadata["io.kubernetes.cri.container-type"] == "sandbox" {
let is_sandbox = if let Some(value) = image_metadata.get("io.kubernetes.cri.container-type")
{
value == "sandbox"
} else if let Some(value) = image_metadata.get("io.kubernetes.cri-o.ContainerType") {
value == "sandbox"
} else {
false
};
if is_sandbox {
let mount_path = Self::unpack_pause_image(cid, "pause")?;
self.add_image(String::from(image), String::from(cid)).await;
return Ok(mount_path);