mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
deps: update buildkit, vendor changes
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
5
vendor/github.com/moby/buildkit/util/testutil/integration/registry.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/testutil/integration/registry.go
generated
vendored
@ -67,8 +67,9 @@ http:
|
||||
}
|
||||
deferF.Append(stop)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
ctx, cancel := context.WithCancelCause(context.Background())
|
||||
ctx, _ = context.WithTimeoutCause(ctx, 5*time.Second, errors.WithStack(context.DeadlineExceeded))
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
url, err = detectPort(ctx, rc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
|
7
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
7
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
@ -423,3 +423,10 @@ func prepareValueMatrix(tc testConf) []matrixValue {
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// Skips tests on Windows
|
||||
func SkipOnPlatform(t *testing.T, goos string) {
|
||||
if runtime.GOOS == goos {
|
||||
t.Skipf("Skipped on %s", goos)
|
||||
}
|
||||
}
|
||||
|
2
vendor/github.com/moby/buildkit/util/testutil/integration/sandbox.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/testutil/integration/sandbox.go
generated
vendored
@ -99,7 +99,7 @@ func newSandbox(ctx context.Context, w Worker, mirror string, mv matrixValue) (s
|
||||
|
||||
b, closer, err := w.New(ctx, cfg)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
return nil, nil, errors.Wrap(err, "creating worker")
|
||||
}
|
||||
deferF.Append(closer)
|
||||
|
||||
|
15
vendor/github.com/moby/buildkit/util/testutil/integration/util.go
generated
vendored
15
vendor/github.com/moby/buildkit/util/testutil/integration/util.go
generated
vendored
@ -5,7 +5,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
@ -100,13 +99,11 @@ func StartCmd(cmd *exec.Cmd, logs map[string]*bytes.Buffer) (func() error, error
|
||||
}, nil
|
||||
}
|
||||
|
||||
func WaitUnix(address string, d time.Duration, cmd *exec.Cmd) error {
|
||||
address = strings.TrimPrefix(address, "unix://")
|
||||
addr, err := net.ResolveUnixAddr("unix", address)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed resolving unix addr: %s", address)
|
||||
}
|
||||
|
||||
// WaitSocket will dial a socket opened by a command passed in as cmd.
|
||||
// On Linux this socket is typically a Unix socket,
|
||||
// while on Windows this will be a named pipe.
|
||||
func WaitSocket(address string, d time.Duration, cmd *exec.Cmd) error {
|
||||
address = strings.TrimPrefix(address, socketScheme)
|
||||
step := 50 * time.Millisecond
|
||||
i := 0
|
||||
for {
|
||||
@ -114,7 +111,7 @@ func WaitUnix(address string, d time.Duration, cmd *exec.Cmd) error {
|
||||
return errors.Errorf("process exited: %s", cmd.String())
|
||||
}
|
||||
|
||||
if conn, err := net.DialUnix("unix", nil, addr); err == nil {
|
||||
if conn, err := dialPipe(address); err == nil {
|
||||
conn.Close()
|
||||
break
|
||||
}
|
||||
|
23
vendor/github.com/moby/buildkit/util/testutil/integration/util_unix.go
generated
vendored
Normal file
23
vendor/github.com/moby/buildkit/util/testutil/integration/util_unix.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var socketScheme = "unix://"
|
||||
|
||||
// abstracted function to handle pipe dialing on unix.
|
||||
// some simplification has been made to discard
|
||||
// laddr for unix -- left as nil.
|
||||
func dialPipe(address string) (net.Conn, error) {
|
||||
addr, err := net.ResolveUnixAddr("unix", address)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed resolving unix addr: %s", address)
|
||||
}
|
||||
return net.DialUnix("unix", nil, addr)
|
||||
}
|
15
vendor/github.com/moby/buildkit/util/testutil/integration/util_windows.go
generated
vendored
Normal file
15
vendor/github.com/moby/buildkit/util/testutil/integration/util_windows.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/Microsoft/go-winio"
|
||||
)
|
||||
|
||||
var socketScheme = "npipe://"
|
||||
|
||||
// abstracted function to handle pipe dialing on windows.
|
||||
// some simplification has been made to discard timeout param.
|
||||
func dialPipe(address string) (net.Conn, error) {
|
||||
return winio.DialPipe(address, nil)
|
||||
}
|
Reference in New Issue
Block a user