Revert "Introduce a client interface, to abstract from buildkit client."

This reverts commit 2aa6d52b06.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki
2023-10-11 22:11:21 +02:00
parent 0e3911147a
commit 22e9e3342b
9 changed files with 17 additions and 36 deletions

View File

@ -8,6 +8,7 @@ import (
"github.com/docker/buildx/util/progress"
clitypes "github.com/docker/cli/cli/config/types"
controlapi "github.com/moby/buildkit/api/services/control"
"github.com/moby/buildkit/client"
"github.com/pkg/errors"
)
@ -57,13 +58,13 @@ type Driver interface {
Version(context.Context) (string, error)
Stop(ctx context.Context, force bool) error
Rm(ctx context.Context, force, rmVolume, rmDaemon bool) error
Client(ctx context.Context) (Client, error)
Client(ctx context.Context) (*client.Client, error)
Features(ctx context.Context) map[Feature]bool
IsMobyDriver() bool
Config() InitConfig
}
func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Writer) (Client, error) {
func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Writer) (*client.Client, error) {
try := 0
for {
info, err := d.Info(ctx)
@ -91,7 +92,7 @@ func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Write
}
}
func historyAPISupported(ctx context.Context, c Client) bool {
func historyAPISupported(ctx context.Context, c *client.Client) bool {
cl, err := c.ControlClient().ListenBuildHistory(ctx, &controlapi.BuildHistoryRequest{
ActiveOnly: true,
Ref: "buildx-test-history-api-feature", // dummy ref to check if the server supports the API