vendor: github.com/moby/moby/api v1.52.0, moby/client v0.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -3,7 +3,7 @@ package dockerutil
|
||||
import (
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/cli/cli/context/docker"
|
||||
dockerclient "github.com/docker/docker/client"
|
||||
dockerclient "github.com/moby/moby/client"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
)
|
||||
@@ -42,7 +42,7 @@ func NewClientAPI(cli command.Cli, ep string) (*ClientAPI, error) {
|
||||
propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}),
|
||||
)))
|
||||
|
||||
ca.APIClient, err = dockerclient.NewClientWithOpts(clientOpts...)
|
||||
ca.APIClient, err = dockerclient.New(clientOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/docker/buildx/util/progress"
|
||||
"github.com/docker/cli/cli/command"
|
||||
dockerclient "github.com/docker/docker/client"
|
||||
dockerclient "github.com/moby/moby/client"
|
||||
)
|
||||
|
||||
// Client represents an active docker object.
|
||||
@@ -61,7 +61,7 @@ func (c *Client) LoadImage(ctx context.Context, name string, status progress.Wri
|
||||
|
||||
status = progress.ResetTime(status)
|
||||
if err := progress.Wrap("importing to docker", status.Write, func(l progress.SubLogger) error {
|
||||
return fromReader(l, resp.Body)
|
||||
return fromReader(l, resp)
|
||||
}); err != nil {
|
||||
handleErr(err)
|
||||
}
|
||||
@@ -83,8 +83,8 @@ func (c *Client) Features(ctx context.Context, name string) map[Feature]bool {
|
||||
func (c *Client) features(ctx context.Context, name string) map[Feature]bool {
|
||||
features := make(map[Feature]bool)
|
||||
if dapi, err := c.API(name); err == nil {
|
||||
if info, err := dapi.Info(ctx); err == nil {
|
||||
for _, v := range info.DriverStatus {
|
||||
if res, err := dapi.Info(ctx, dockerclient.InfoOptions{}); err == nil {
|
||||
for _, v := range res.Info.DriverStatus {
|
||||
switch v[0] {
|
||||
case "driver-type":
|
||||
if v[1] == "io.containerd.snapshotter.v1" {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/buildx/util/progress"
|
||||
"github.com/docker/docker/pkg/jsonmessage"
|
||||
"github.com/moby/buildkit/client"
|
||||
"github.com/moby/moby/api/types/jsonstream"
|
||||
)
|
||||
|
||||
const minTimeDelta = 2 * time.Second
|
||||
@@ -27,7 +27,7 @@ func fromReader(l progress.SubLogger, rc io.ReadCloser) error {
|
||||
|
||||
dec := json.NewDecoder(rc)
|
||||
var parsedErr error
|
||||
var jm jsonmessage.JSONMessage
|
||||
var jm jsonstream.Message
|
||||
for {
|
||||
if err := dec.Decode(&jm); err != nil {
|
||||
if parsedErr != nil {
|
||||
|
||||
Reference in New Issue
Block a user