build: sublogger to show docker load progress output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-08-08 08:38:52 +02:00
committed by CrazyMax
parent 42a0f3d504
commit 03bedfb3c3
3 changed files with 66 additions and 39 deletions

View File

@ -60,8 +60,10 @@ func (c *Client) LoadImage(ctx context.Context, name string, status progress.Wri
return
}
prog := progress.WithPrefix(status, "", false)
if err := fromReader(prog, "importing to docker", resp.Body); err != nil {
status = progress.ResetTime(status)
if err := progress.Wrap("importing to docker", status.Write, func(l progress.SubLogger) error {
return fromReader(l, resp.Body)
}); err != nil {
handleErr(err)
}
},