mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to v0.20.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
2
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/testutil/integration/run.go
generated
vendored
@ -60,12 +60,14 @@ type Sandbox interface {
|
||||
NewRegistry() (string, error)
|
||||
Value(string) interface{} // chosen matrix value
|
||||
Name() string
|
||||
CDISpecDir() string
|
||||
}
|
||||
|
||||
// BackendConfig is used to configure backends created by a worker.
|
||||
type BackendConfig struct {
|
||||
Logs map[string]*bytes.Buffer
|
||||
DaemonConfig []ConfigUpdater
|
||||
CDISpecDir string
|
||||
}
|
||||
|
||||
type Worker interface {
|
||||
|
37
vendor/github.com/moby/buildkit/util/testutil/integration/sandbox.go
generated
vendored
37
vendor/github.com/moby/buildkit/util/testutil/integration/sandbox.go
generated
vendored
@ -27,11 +27,12 @@ const maxSandboxTimeout = 5 * time.Minute
|
||||
type sandbox struct {
|
||||
Backend
|
||||
|
||||
logs map[string]*bytes.Buffer
|
||||
cleanup *MultiCloser
|
||||
mv matrixValue
|
||||
ctx context.Context
|
||||
name string
|
||||
logs map[string]*bytes.Buffer
|
||||
cleanup *MultiCloser
|
||||
mv matrixValue
|
||||
ctx context.Context
|
||||
cdiSpecDir string
|
||||
name string
|
||||
}
|
||||
|
||||
func (sb *sandbox) Name() string {
|
||||
@ -42,6 +43,10 @@ func (sb *sandbox) Context() context.Context {
|
||||
return sb.ctx
|
||||
}
|
||||
|
||||
func (sb *sandbox) CDISpecDir() string {
|
||||
return sb.cdiSpecDir
|
||||
}
|
||||
|
||||
func (sb *sandbox) Logs() map[string]*bytes.Buffer {
|
||||
return sb.logs
|
||||
}
|
||||
@ -110,6 +115,15 @@ func newSandbox(ctx context.Context, t *testing.T, w Worker, mirror string, mv m
|
||||
}
|
||||
}()
|
||||
|
||||
cdiSpecDir, err := os.MkdirTemp("", "buildkit-integration-cdi")
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "cannot create cdi spec dir")
|
||||
}
|
||||
deferF.Append(func() error {
|
||||
return os.RemoveAll(cdiSpecDir)
|
||||
})
|
||||
cfg.CDISpecDir = cdiSpecDir
|
||||
|
||||
b, closer, err := w.New(ctx, cfg)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "creating worker")
|
||||
@ -139,12 +153,13 @@ func newSandbox(ctx context.Context, t *testing.T, w Worker, mirror string, mv m
|
||||
}()
|
||||
|
||||
return &sandbox{
|
||||
Backend: b,
|
||||
logs: cfg.Logs,
|
||||
cleanup: deferF,
|
||||
mv: mv,
|
||||
ctx: ctx,
|
||||
name: w.Name(),
|
||||
Backend: b,
|
||||
logs: cfg.Logs,
|
||||
cleanup: deferF,
|
||||
mv: mv,
|
||||
ctx: ctx,
|
||||
cdiSpecDir: cfg.CDISpecDir,
|
||||
name: w.Name(),
|
||||
}, cl, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user