Skip to content

Commit cc097db

Browse files
committed
bake: fix printer reset before metadata written
Signed-off-by: Tonis Tiigi <[email protected]>
1 parent 35313e8 commit cc097db

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

commands/bake.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
302302
}
303303

304304
err = printer.Wait()
305-
printer = nil
306305
if err != nil {
307306
return err
308307
}

util/progress/printer.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ import (
1919
type Printer struct {
2020
status chan *client.SolveStatus
2121

22-
ready chan struct{}
23-
done chan struct{}
24-
paused chan struct{}
22+
ready chan struct{}
23+
done chan struct{}
24+
paused chan struct{}
25+
closeOnce sync.Once
2526

2627
err error
2728
warnings []client.VertexWarning
@@ -36,8 +37,10 @@ type Printer struct {
3637
}
3738

3839
func (p *Printer) Wait() error {
39-
close(p.status)
40-
<-p.done
40+
p.closeOnce.Do(func() {
41+
close(p.status)
42+
<-p.done
43+
})
4144
return p.err
4245
}
4346

0 commit comments

Comments
 (0)