mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit 25bec7145b39 (v0.14.0-dev)
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
5
vendor/github.com/moby/buildkit/util/testutil/workers/backend.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/testutil/workers/backend.go
generated
vendored
@ -12,6 +12,7 @@ type backend struct {
|
||||
rootless bool
|
||||
netnsDetached bool
|
||||
snapshotter string
|
||||
extraEnv []string
|
||||
unsupportedFeatures []string
|
||||
isDockerd bool
|
||||
}
|
||||
@ -40,6 +41,10 @@ func (b backend) Snapshotter() string {
|
||||
return b.snapshotter
|
||||
}
|
||||
|
||||
func (b backend) ExtraEnv() []string {
|
||||
return b.extraEnv
|
||||
}
|
||||
|
||||
func (b backend) Supports(feature string) bool {
|
||||
if enabledFeatures := os.Getenv("BUILDKIT_TEST_ENABLE_FEATURES"); enabledFeatures != "" {
|
||||
for _, enabledFeature := range strings.Split(enabledFeatures, ",") {
|
||||
|
1
vendor/github.com/moby/buildkit/util/testutil/workers/containerd.go
generated
vendored
1
vendor/github.com/moby/buildkit/util/testutil/workers/containerd.go
generated
vendored
@ -244,6 +244,7 @@ disabled_plugins = ["cri"]
|
||||
rootless: rootless,
|
||||
netnsDetached: false,
|
||||
snapshotter: c.Snapshotter,
|
||||
extraEnv: c.ExtraEnv,
|
||||
}, cl, nil
|
||||
}
|
||||
|
||||
|
21
vendor/github.com/moby/buildkit/util/testutil/workers/dockerd.go
generated
vendored
21
vendor/github.com/moby/buildkit/util/testutil/workers/dockerd.go
generated
vendored
@ -55,12 +55,12 @@ func InitDockerdWorker() {
|
||||
}
|
||||
|
||||
type Moby struct {
|
||||
ID string
|
||||
IsRootless bool
|
||||
|
||||
ID string
|
||||
Binary string
|
||||
IsRootless bool
|
||||
ContainerdSnapshotter bool
|
||||
|
||||
Unsupported []string
|
||||
Unsupported []string
|
||||
ExtraEnv []string
|
||||
}
|
||||
|
||||
func (c Moby) Name() string {
|
||||
@ -137,7 +137,13 @@ func (c Moby) New(ctx context.Context, cfg *integration.BackendConfig) (b integr
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
d, err := dockerd.NewDaemon(workDir)
|
||||
dockerdOpts := []dockerd.Option{
|
||||
dockerd.WithExtraEnv(c.ExtraEnv),
|
||||
}
|
||||
if c.Binary != "" {
|
||||
dockerdOpts = append(dockerdOpts, dockerd.WithBinary(c.Binary))
|
||||
}
|
||||
d, err := dockerd.NewDaemon(workDir, dockerdOpts...)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Errorf("new daemon error: %q, %s", err, integration.FormatLogs(cfg.Logs))
|
||||
}
|
||||
@ -164,7 +170,7 @@ func (c Moby) New(ctx context.Context, cfg *integration.BackendConfig) (b integr
|
||||
deferF.Append(d.StopWithError)
|
||||
|
||||
if err := integration.WaitSocket(d.Sock(), 5*time.Second, nil); err != nil {
|
||||
return nil, nil, errors.Errorf("dockerd did not start up: %q, %s", err, integration.FormatLogs(cfg.Logs))
|
||||
return nil, nil, errors.Wrapf(err, "dockerd did not start up: %s", integration.FormatLogs(cfg.Logs))
|
||||
}
|
||||
|
||||
dockerAPI, err := client.NewClientWithOpts(client.WithHost(d.Sock()))
|
||||
@ -229,6 +235,7 @@ func (c Moby) New(ctx context.Context, cfg *integration.BackendConfig) (b integr
|
||||
dockerAddress: d.Sock(),
|
||||
rootless: c.IsRootless,
|
||||
netnsDetached: false,
|
||||
extraEnv: c.ExtraEnv,
|
||||
isDockerd: true,
|
||||
unsupportedFeatures: c.Unsupported,
|
||||
}, cl, nil
|
||||
|
Reference in New Issue
Block a user