mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: update buildkit to 664c2b469f19
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
5
vendor/github.com/moby/buildkit/util/grpcerrors/grpcerrors.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/grpcerrors/grpcerrors.go
generated
vendored
@ -10,6 +10,7 @@ import (
|
||||
gogotypes "github.com/gogo/protobuf/types"
|
||||
"github.com/golang/protobuf/proto" //nolint:staticcheck
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/moby/buildkit/errdefs"
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
"github.com/moby/buildkit/util/stack"
|
||||
spb "google.golang.org/genproto/googleapis/rpc/status"
|
||||
@ -94,6 +95,10 @@ func withDetails(ctx context.Context, s *status.Status, details ...proto.Message
|
||||
}
|
||||
|
||||
func Code(err error) codes.Code {
|
||||
if errdefs.IsInternal(err) {
|
||||
return codes.Internal
|
||||
}
|
||||
|
||||
if se, ok := err.(interface {
|
||||
Code() codes.Code
|
||||
}); ok {
|
||||
|
6
vendor/github.com/moby/buildkit/util/resolver/retryhandler/retry.go
generated
vendored
6
vendor/github.com/moby/buildkit/util/resolver/retryhandler/retry.go
generated
vendored
@ -64,11 +64,7 @@ func retryError(err error) bool {
|
||||
return true
|
||||
}
|
||||
// catches TLS timeout or other network-related temporary errors
|
||||
if ne, ok := errors.Cause(err).(net.Error); ok && ne.Temporary() { //nolint:staticcheck // ignoring "SA1019: Temporary is deprecated", continue to propagate net.Error through the "temporary" status
|
||||
return true
|
||||
}
|
||||
// https://github.com/containerd/containerd/pull/4724
|
||||
if errors.Cause(err).Error() == "no response" {
|
||||
if ne := net.Error(nil); errors.As(err, &ne) && ne.Temporary() { //nolint:staticcheck // ignoring "SA1019: Temporary is deprecated", continue to propagate net.Error through the "temporary" status
|
||||
return true
|
||||
}
|
||||
|
||||
|
3
vendor/github.com/moby/buildkit/util/testutil/integration/pins.go
generated
vendored
3
vendor/github.com/moby/buildkit/util/testutil/integration/pins.go
generated
vendored
@ -1,3 +1,6 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package integration
|
||||
|
||||
var pins = map[string]map[string]string{
|
||||
|
34
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
34
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
@ -189,7 +189,9 @@ func Run(t *testing.T, testCases []Test, opt ...TestOpt) {
|
||||
t.Skip("rootless")
|
||||
}
|
||||
ctx := appcontext.Context()
|
||||
if !strings.HasSuffix(fn, "NoParallel") {
|
||||
// TODO(profnandaa): to revisit this to allow tests run
|
||||
// in parallel on Windows in a stable way. Is flaky currently.
|
||||
if !strings.HasSuffix(fn, "NoParallel") && runtime.GOOS != "windows" {
|
||||
t.Parallel()
|
||||
}
|
||||
require.NoError(t, sandboxLimiter.Acquire(context.TODO(), 1))
|
||||
@ -273,23 +275,7 @@ func copyImagesLocal(t *testing.T, host string, images map[string]string) error
|
||||
}
|
||||
|
||||
func OfficialImages(names ...string) map[string]string {
|
||||
ns := runtime.GOARCH
|
||||
if ns == "arm64" {
|
||||
ns = "arm64v8"
|
||||
} else if ns != "amd64" {
|
||||
ns = "library"
|
||||
}
|
||||
m := map[string]string{}
|
||||
for _, name := range names {
|
||||
ref := "docker.io/" + ns + "/" + name
|
||||
if pns, ok := pins[name]; ok {
|
||||
if dgst, ok := pns[ns]; ok {
|
||||
ref += "@" + dgst
|
||||
}
|
||||
}
|
||||
m["library/"+name] = ref
|
||||
}
|
||||
return m
|
||||
return officialImages(names...)
|
||||
}
|
||||
|
||||
func withMirrorConfig(mirror string) ConfigUpdater {
|
||||
@ -439,9 +425,19 @@ func prepareValueMatrix(tc testConf) []matrixValue {
|
||||
return m
|
||||
}
|
||||
|
||||
// Skips tests on Windows
|
||||
// Skips tests on platform
|
||||
func SkipOnPlatform(t *testing.T, goos string) {
|
||||
if runtime.GOOS == goos {
|
||||
t.Skipf("Skipped on %s", goos)
|
||||
}
|
||||
}
|
||||
|
||||
// Selects between two types, returns second
|
||||
// argument if on Windows or else first argument.
|
||||
// Typically used for selecting test cases.
|
||||
func UnixOrWindows[T any](unix, windows T) T {
|
||||
if runtime.GOOS == "windows" {
|
||||
return windows
|
||||
}
|
||||
return unix
|
||||
}
|
||||
|
26
vendor/github.com/moby/buildkit/util/testutil/integration/run_unix.go
generated
vendored
Normal file
26
vendor/github.com/moby/buildkit/util/testutil/integration/run_unix.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package integration
|
||||
|
||||
import "runtime"
|
||||
|
||||
func officialImages(names ...string) map[string]string {
|
||||
ns := runtime.GOARCH
|
||||
if ns == "arm64" {
|
||||
ns = "arm64v8"
|
||||
} else if ns != "amd64" {
|
||||
ns = "library"
|
||||
}
|
||||
m := map[string]string{}
|
||||
for _, name := range names {
|
||||
ref := "docker.io/" + ns + "/" + name
|
||||
if pns, ok := pins[name]; ok {
|
||||
if dgst, ok := pns[ns]; ok {
|
||||
ref += "@" + dgst
|
||||
}
|
||||
}
|
||||
m["library/"+name] = ref
|
||||
}
|
||||
return m
|
||||
}
|
13
vendor/github.com/moby/buildkit/util/testutil/integration/run_windows.go
generated
vendored
Normal file
13
vendor/github.com/moby/buildkit/util/testutil/integration/run_windows.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
package integration
|
||||
|
||||
func officialImages(names ...string) map[string]string {
|
||||
m := map[string]string{}
|
||||
for _, name := range names {
|
||||
// select available refs from the mirror map
|
||||
// so that we mirror only those needed for the tests
|
||||
if ref, ok := windowsImagesMirrorMap[name]; ok {
|
||||
m["library/"+name] = ref
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
6
vendor/github.com/moby/buildkit/util/testutil/integration/util.go
generated
vendored
6
vendor/github.com/moby/buildkit/util/testutil/integration/util.go
generated
vendored
@ -94,8 +94,12 @@ func StartCmd(cmd *exec.Cmd, logs map[string]*bytes.Buffer) (func() error, error
|
||||
case <-ctx.Done():
|
||||
case <-stopped:
|
||||
case <-stop:
|
||||
// windows processes not responding to SIGTERM
|
||||
signal := UnixOrWindows(syscall.SIGTERM, syscall.SIGKILL)
|
||||
signalStr := UnixOrWindows("SIGTERM", "SIGKILL")
|
||||
fmt.Fprintf(cmd.Stderr, "> sending sigterm %v\n", time.Now())
|
||||
cmd.Process.Signal(syscall.SIGTERM)
|
||||
fmt.Fprintf(cmd.Stderr, "> sending %s %v\n", signalStr, time.Now())
|
||||
cmd.Process.Signal(signal)
|
||||
go func() {
|
||||
select {
|
||||
case <-stopped:
|
||||
|
7
vendor/github.com/moby/buildkit/util/testutil/integration/util_windows.go
generated
vendored
7
vendor/github.com/moby/buildkit/util/testutil/integration/util_windows.go
generated
vendored
@ -11,6 +11,13 @@ import (
|
||||
|
||||
var socketScheme = "npipe://"
|
||||
|
||||
var windowsImagesMirrorMap = map[string]string{
|
||||
// TODO(profnandaa): currently, amd64 only, to revisit for other archs.
|
||||
"nanoserver:latest": "mcr.microsoft.com/windows/nanoserver:ltsc2022",
|
||||
"servercore:latest": "mcr.microsoft.com/windows/servercore:ltsc2022",
|
||||
"busybox:latest": "registry.k8s.io/e2e-test-images/busybox@sha256:6d854ffad9666d2041b879a1c128c9922d77faced7745ad676639b07111ab650",
|
||||
}
|
||||
|
||||
// abstracted function to handle pipe dialing on windows.
|
||||
// some simplification has been made to discard timeout param.
|
||||
func dialPipe(address string) (net.Conn, error) {
|
||||
|
Reference in New Issue
Block a user