bake: print warnings on progress

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2024-06-17 11:55:09 -07:00
parent 818045482e
commit c1f680df14
No known key found for this signature in database
GPG Key ID: AFA9DE5F8AB7AF39
1 changed files with 5 additions and 1 deletions

View File

@ -124,8 +124,12 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
}
progressMode := progressui.DisplayMode(cFlags.progress)
printer, err := progress.NewPrinter(ctx2, os.Stderr, progressMode,
var printer *progress.Printer
printer, err = progress.NewPrinter(ctx2, os.Stderr, progressMode,
progress.WithDesc(progressTextDesc, progressConsoleDesc),
progress.WithOnClose(func() {
printWarnings(os.Stderr, printer.Warnings(), progressMode)
}),
)
if err != nil {
return err