Skip to content

Commit

Permalink
Merge pull request #2130 from jsternberg/remote-bootstrap-timeout
Browse files Browse the repository at this point in the history
driver: add status reporting and a timeout to the remote driver bootstrap
  • Loading branch information
tonistiigi authored Nov 17, 2023
2 parents a102d33 + 1f55623 commit 0962fdb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion driver/remote/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"net"
"time"

"github.com/docker/buildx/driver"
"github.com/docker/buildx/util/progress"
Expand Down Expand Up @@ -32,7 +33,11 @@ func (d *Driver) Bootstrap(ctx context.Context, l progress.Logger) error {
if err != nil {
return err
}
return c.Wait(ctx)
return progress.Wrap("[internal] waiting for connection", l, func(_ progress.SubLogger) error {
ctx, cancel := context.WithTimeout(ctx, 20*time.Second)
defer cancel()
return c.Wait(ctx)
})
}

func (d *Driver) Info(ctx context.Context) (*driver.Info, error) {
Expand Down

0 comments on commit 0962fdb

Please sign in to comment.