Skip to content

Commit

Permalink
bake: fix printer reset before metadata written
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Jun 29, 2024
1 parent bbb9721 commit 5d97a08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion commands/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
}

err = printer.Wait()
printer = nil
if err != nil {
return err
}
Expand Down
13 changes: 8 additions & 5 deletions util/progress/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
type Printer struct {
status chan *client.SolveStatus

ready chan struct{}
done chan struct{}
paused chan struct{}
ready chan struct{}
done chan struct{}
paused chan struct{}
closeOnce sync.Once

err error
warnings []client.VertexWarning
Expand All @@ -36,8 +37,10 @@ type Printer struct {
}

func (p *Printer) Wait() error {
close(p.status)
<-p.done
p.closeOnce.Do(func() {
close(p.status)
<-p.done
})
return p.err
}

Expand Down

0 comments on commit 5d97a08

Please sign in to comment.