mirror of https://github.com/docker/buildx.git
bake: fix printer reset before metadata written
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
35313e865f
commit
cc097db675
|
@ -302,7 +302,6 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
|
||||||
}
|
}
|
||||||
|
|
||||||
err = printer.Wait()
|
err = printer.Wait()
|
||||||
printer = nil
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,10 @@ import (
|
||||||
type Printer struct {
|
type Printer struct {
|
||||||
status chan *client.SolveStatus
|
status chan *client.SolveStatus
|
||||||
|
|
||||||
ready chan struct{}
|
ready chan struct{}
|
||||||
done chan struct{}
|
done chan struct{}
|
||||||
paused chan struct{}
|
paused chan struct{}
|
||||||
|
closeOnce sync.Once
|
||||||
|
|
||||||
err error
|
err error
|
||||||
warnings []client.VertexWarning
|
warnings []client.VertexWarning
|
||||||
|
@ -36,8 +37,10 @@ type Printer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Printer) Wait() error {
|
func (p *Printer) Wait() error {
|
||||||
close(p.status)
|
p.closeOnce.Do(func() {
|
||||||
<-p.done
|
close(p.status)
|
||||||
|
<-p.done
|
||||||
|
})
|
||||||
return p.err
|
return p.err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue