mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: update buildkit to v0.18.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
1
vendor/github.com/moby/buildkit/util/appcontext/appcontext_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/appcontext/appcontext_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package appcontext
|
||||
|
||||
|
1
vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/appdefaults/appdefaults_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package appdefaults
|
||||
|
||||
|
1
vendor/github.com/moby/buildkit/util/disk/disk_openbsd.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/disk/disk_openbsd.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build openbsd
|
||||
// +build openbsd
|
||||
|
||||
package disk
|
||||
|
||||
|
1
vendor/github.com/moby/buildkit/util/disk/disk_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/disk/disk_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows && !openbsd
|
||||
// +build !windows,!openbsd
|
||||
|
||||
package disk
|
||||
|
||||
|
1
vendor/github.com/moby/buildkit/util/disk/disk_windows.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/disk/disk_windows.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package disk
|
||||
|
||||
|
4
vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go
generated
vendored
4
vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go
generated
vendored
@ -118,7 +118,7 @@ func newCall[T any](fn func(ctx context.Context) (T, error)) *call[T] {
|
||||
func (c *call[T]) run() {
|
||||
defer c.closeProgressWriter(errors.WithStack(context.Canceled))
|
||||
ctx, cancel := context.WithCancelCause(c.ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
defer func() { cancel(errors.WithStack(context.Canceled)) }()
|
||||
v, err := c.fn(ctx)
|
||||
c.mu.Lock()
|
||||
c.result = v
|
||||
@ -157,7 +157,7 @@ func (c *call[T]) wait(ctx context.Context) (v T, err error) {
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
defer func() { cancel(errors.WithStack(context.Canceled)) }()
|
||||
|
||||
c.ctxs = append(c.ctxs, ctx)
|
||||
|
||||
|
21
vendor/github.com/moby/buildkit/util/system/atime_unix.go
generated
vendored
21
vendor/github.com/moby/buildkit/util/system/atime_unix.go
generated
vendored
@ -1,21 +0,0 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
iofs "io/fs"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/continuity/fs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func Atime(st iofs.FileInfo) (time.Time, error) {
|
||||
stSys, ok := st.Sys().(*syscall.Stat_t)
|
||||
if !ok {
|
||||
return time.Time{}, errors.Errorf("expected st.Sys() to be *syscall.Stat_t, got %T", st.Sys())
|
||||
}
|
||||
return fs.StatATimeAsTime(stSys), nil
|
||||
}
|
18
vendor/github.com/moby/buildkit/util/system/atime_windows.go
generated
vendored
18
vendor/github.com/moby/buildkit/util/system/atime_windows.go
generated
vendored
@ -1,18 +0,0 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
iofs "io/fs"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func Atime(st iofs.FileInfo) (time.Time, error) {
|
||||
stSys, ok := st.Sys().(*syscall.Win32FileAttributeData)
|
||||
if !ok {
|
||||
return time.Time{}, errors.Errorf("expected st.Sys() to be *syscall.Win32FileAttributeData, got %T", st.Sys())
|
||||
}
|
||||
// ref: https://github.com/golang/go/blob/go1.19.2/src/os/types_windows.go#L230
|
||||
return time.Unix(0, stSys.LastAccessTime.Nanoseconds()), nil
|
||||
}
|
1
vendor/github.com/moby/buildkit/util/testutil/integration/pins.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/testutil/integration/pins.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package integration
|
||||
|
||||
|
2
vendor/github.com/moby/buildkit/util/testutil/integration/registry.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/testutil/integration/registry.go
generated
vendored
@ -69,7 +69,7 @@ http:
|
||||
|
||||
ctx, cancel := context.WithCancelCause(context.Background())
|
||||
ctx, _ = context.WithTimeoutCause(ctx, 5*time.Second, errors.WithStack(context.DeadlineExceeded))
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
defer func() { cancel(errors.WithStack(context.Canceled)) }()
|
||||
url, err = detectPort(ctx, rc)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
|
13
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
13
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
@ -198,7 +198,7 @@ func Run(t *testing.T, testCases []Test, opt ...TestOpt) {
|
||||
defer sandboxLimiter.Release(1)
|
||||
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
defer func() { cancel(errors.WithStack(context.Canceled)) }()
|
||||
|
||||
sb, closer, err := newSandbox(ctx, br, getMirror(), mv)
|
||||
require.NoError(t, err)
|
||||
@ -427,7 +427,16 @@ func prepareValueMatrix(tc testConf) []matrixValue {
|
||||
|
||||
// Skips tests on platform
|
||||
func SkipOnPlatform(t *testing.T, goos string) {
|
||||
if runtime.GOOS == goos {
|
||||
skip := false
|
||||
// support for negation
|
||||
if strings.HasPrefix(goos, "!") {
|
||||
goos = strings.TrimPrefix(goos, "!")
|
||||
skip = runtime.GOOS != goos
|
||||
} else {
|
||||
skip = runtime.GOOS == goos
|
||||
}
|
||||
|
||||
if skip {
|
||||
t.Skipf("Skipped on %s", goos)
|
||||
}
|
||||
}
|
||||
|
1
vendor/github.com/moby/buildkit/util/testutil/integration/run_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/testutil/integration/run_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package integration
|
||||
|
||||
|
1
vendor/github.com/moby/buildkit/util/testutil/integration/util_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/testutil/integration/util_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package integration
|
||||
|
||||
|
5
vendor/github.com/moby/buildkit/util/testutil/workers/containerd.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/testutil/workers/containerd.go
generated
vendored
@ -135,11 +135,12 @@ func (c *Containerd) New(ctx context.Context, cfg *integration.BackendConfig) (b
|
||||
deferF.Append(func() error { return os.RemoveAll(tmpdir) })
|
||||
|
||||
address := getContainerdSock(tmpdir)
|
||||
config := fmt.Sprintf(`root = %q
|
||||
config := fmt.Sprintf(`version = 2
|
||||
root = %q
|
||||
state = %q
|
||||
# CRI plugins listens on 10010/tcp for stream server.
|
||||
# We disable CRI plugin so that multiple instance can run simultaneously.
|
||||
disabled_plugins = ["cri"]
|
||||
disabled_plugins = ["io.containerd.grpc.v1.cri"]
|
||||
|
||||
[grpc]
|
||||
address = %q
|
||||
|
1
vendor/github.com/moby/buildkit/util/testutil/workers/oci_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/testutil/workers/oci_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package workers
|
||||
|
||||
|
1
vendor/github.com/moby/buildkit/util/testutil/workers/util_unix.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/testutil/workers/util_unix.go
generated
vendored
@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package workers
|
||||
|
||||
|
28
vendor/github.com/moby/buildkit/util/tracing/detect/resource.go
generated
vendored
28
vendor/github.com/moby/buildkit/util/tracing/detect/resource.go
generated
vendored
@ -1,3 +1,6 @@
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package detect
|
||||
|
||||
import (
|
||||
@ -7,8 +10,9 @@ import (
|
||||
"sync"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/sdk"
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -23,7 +27,7 @@ func Resource() *resource.Resource {
|
||||
res, err := resource.New(context.Background(),
|
||||
resource.WithDetectors(serviceNameDetector{}),
|
||||
resource.WithFromEnv(),
|
||||
resource.WithTelemetrySDK(),
|
||||
resource.WithDetectors(telemetrySDK{}),
|
||||
)
|
||||
if err != nil {
|
||||
otel.Handle(err)
|
||||
@ -42,7 +46,15 @@ func OverrideResource(res *resource.Resource) {
|
||||
})
|
||||
}
|
||||
|
||||
type serviceNameDetector struct{}
|
||||
type (
|
||||
telemetrySDK struct{}
|
||||
serviceNameDetector struct{}
|
||||
)
|
||||
|
||||
var (
|
||||
_ resource.Detector = telemetrySDK{}
|
||||
_ resource.Detector = serviceNameDetector{}
|
||||
)
|
||||
|
||||
func (serviceNameDetector) Detect(ctx context.Context) (*resource.Resource, error) {
|
||||
return resource.StringDetector(
|
||||
@ -56,3 +68,13 @@ func (serviceNameDetector) Detect(ctx context.Context) (*resource.Resource, erro
|
||||
},
|
||||
).Detect(ctx)
|
||||
}
|
||||
|
||||
// Detect returns a *Resource that describes the OpenTelemetry SDK used.
|
||||
func (telemetrySDK) Detect(context.Context) (*resource.Resource, error) {
|
||||
return resource.NewWithAttributes(
|
||||
semconv.SchemaURL,
|
||||
semconv.TelemetrySDKName("opentelemetry"),
|
||||
semconv.TelemetrySDKLanguageGo,
|
||||
semconv.TelemetrySDKVersion(sdk.Version()),
|
||||
), nil
|
||||
}
|
||||
|
2
vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc/client.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc/client.go
generated
vendored
@ -70,7 +70,7 @@ func (c *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc
|
||||
}
|
||||
|
||||
ctx, cancel := c.connection.ContextWithStop(ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
defer func() { cancel(errors.WithStack(context.Canceled)) }()
|
||||
ctx, tCancel := context.WithCancelCause(ctx)
|
||||
ctx, _ = context.WithTimeoutCause(ctx, 30*time.Second, errors.WithStack(context.DeadlineExceeded))
|
||||
defer tCancel(errors.WithStack(context.Canceled))
|
||||
|
2
vendor/github.com/moby/buildkit/util/tracing/tracing.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/tracing/tracing.go
generated
vendored
@ -11,7 +11,7 @@ import (
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
"go.opentelemetry.io/otel/trace/noop"
|
||||
|
||||
|
Reference in New Issue
Block a user