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:
CrazyMax
2024-03-28 17:43:43 +01:00
parent 8abef59087
commit de5efcb03b
31 changed files with 402 additions and 232 deletions

View File

@ -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, ",") {

View File

@ -244,6 +244,7 @@ disabled_plugins = ["cri"]
rootless: rootless,
netnsDetached: false,
snapshotter: c.Snapshotter,
extraEnv: c.ExtraEnv,
}, cl, nil
}

View File

@ -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