mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
driver: add status reporting and a timeout to the remote driver bootstrap
This adds status reporting for the remote driver so it shows the length of time it is spending waiting for the connection. If the service is already present, this logger isn't shown but it should help provide a message to show the user why the build is stalled. A timeout of 20 seconds has been added to the bootstrap. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
parent
ff8bca206b
commit
1f5562315b
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/docker/buildx/driver"
|
||||
"github.com/docker/buildx/util/progress"
|
||||
@ -29,7 +30,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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user