mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
better pull errors
This commit is contained in:
parent
d67ad60339
commit
0869c89eec
2 changed files with 7 additions and 3 deletions
|
|
@ -175,7 +175,9 @@ impl Database {
|
||||||
if matches!(self, Database::Sqlite) {
|
if matches!(self, Database::Sqlite) {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
pull_image(docker, self.image()).await?;
|
pull_image(docker, self.image())
|
||||||
|
.await
|
||||||
|
.wrap_err("Failed to pull database image")?;
|
||||||
let options = Some(CreateContainerOptions {
|
let options = Some(CreateContainerOptions {
|
||||||
name: format!("{}-db", cloud_id),
|
name: format!("{}-db", cloud_id),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use bollard::image::CreateImageOptions;
|
||||||
use bollard::models::CreateImageInfo;
|
use bollard::models::CreateImageInfo;
|
||||||
use bollard::Docker;
|
use bollard::Docker;
|
||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, WrapErr};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io::stdout;
|
use std::io::stdout;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
@ -29,7 +29,9 @@ pub async fn pull_image(docker: &Docker, image: &str) -> Result<()> {
|
||||||
|
|
||||||
let mut stdout = stdout();
|
let mut stdout = stdout();
|
||||||
while let Some(info) = info_stream.next().await {
|
while let Some(info) = info_stream.next().await {
|
||||||
let info: CreateImageInfo = info.into_diagnostic()?;
|
let info: CreateImageInfo = info
|
||||||
|
.into_diagnostic()
|
||||||
|
.wrap_err_with(|| format!("Error while pulling image {}", image))?;
|
||||||
// dbg!(&info);
|
// dbg!(&info);
|
||||||
if let (Some(id), Some(status), Some(progress)) = (info.id, info.status, info.progress)
|
if let (Some(id), Some(status), Some(progress)) = (info.id, info.status, info.progress)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue