don't blow up if s9pk fails to load (#2231)

This commit is contained in:
Aiden McClelland
2023-03-17 12:09:24 -06:00
committed by GitHub
parent eb5f7f64ad
commit 3d39b5653d

View File

@@ -1435,16 +1435,22 @@ pub fn load_images<'a, P: AsRef<Path> + 'a + Send + Sync>(
copy_and_shutdown(&mut File::open(&path).await?, load_in) copy_and_shutdown(&mut File::open(&path).await?, load_in)
.await? .await?
} }
Some("s9pk") => { Some("s9pk") => match async {
copy_and_shutdown( let mut reader = S9pkReader::open(&path, true).await?;
&mut S9pkReader::open(&path, false) copy_and_shutdown(&mut reader.docker_images().await?, load_in)
.await? .await?;
.docker_images() Ok::<_, Error>(())
.await?,
load_in,
)
.await?
} }
.await
{
Ok(()) => (),
Err(e) => {
tracing::error!(
"Error loading docker images from s9pk: {e}"
);
tracing::debug!("{e:?}");
}
},
_ => unreachable!(), _ => unreachable!(),
}; };