Skip to content

Commit

Permalink
add initial timeout to driver
Browse files Browse the repository at this point in the history
Signed-off-by: Viacheslav Vasilyev <[email protected]>
  • Loading branch information
avoidik committed Sep 21, 2024
1 parent acdcd79 commit 2d42622
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builder/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"sort"
"strings"
"time"

"github.com/containerd/platforms"
"github.com/docker/buildx/driver"
Expand Down Expand Up @@ -38,6 +39,8 @@ type Node struct {
Labels map[string]string
}

const defaultDriverTimeout = 120 * time.Second

// Nodes returns nodes for this builder.
func (b *Builder) Nodes() []Node {
return b.nodes
Expand Down Expand Up @@ -129,6 +132,7 @@ func (b *Builder) LoadNodes(ctx context.Context, opts ...LoadNodesOption) (_ []N
Platforms: n.Platforms,
ContextPathHash: b.opts.contextPathHash,
DialMeta: lno.dialMeta,
Timeout: defaultDriverTimeout,
})
if err != nil {
node.Err = err
Expand Down

0 comments on commit 2d42622

Please sign in to comment.