vendor: github.com/moby/moby/api, moby/client master
full diff: https://github.com/moby/moby/compare/e98849831fc4...9a97f59e6e2d51818f6b8cf8589199fd6714ebc7 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -3,7 +3,6 @@ package checkpoint
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/moby/moby/api/types/checkpoint"
|
||||
"github.com/moby/moby/client"
|
||||
)
|
||||
|
||||
@@ -11,7 +10,7 @@ type fakeClient struct {
|
||||
client.Client
|
||||
checkpointCreateFunc func(container string, options client.CheckpointCreateOptions) error
|
||||
checkpointDeleteFunc func(container string, options client.CheckpointDeleteOptions) error
|
||||
checkpointListFunc func(container string, options client.CheckpointListOptions) ([]checkpoint.Summary, error)
|
||||
checkpointListFunc func(container string, options client.CheckpointListOptions) (client.CheckpointListResult, error)
|
||||
}
|
||||
|
||||
func (cli *fakeClient) CheckpointCreate(_ context.Context, container string, options client.CheckpointCreateOptions) error {
|
||||
@@ -28,9 +27,9 @@ func (cli *fakeClient) CheckpointDelete(_ context.Context, container string, opt
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cli *fakeClient) CheckpointList(_ context.Context, container string, options client.CheckpointListOptions) ([]checkpoint.Summary, error) {
|
||||
func (cli *fakeClient) CheckpointList(_ context.Context, container string, options client.CheckpointListOptions) (client.CheckpointListResult, error) {
|
||||
if cli.checkpointListFunc != nil {
|
||||
return cli.checkpointListFunc(container, options)
|
||||
}
|
||||
return []checkpoint.Summary{}, nil
|
||||
return client.CheckpointListResult{}, nil
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ func newListCommand(dockerCLI command.Cli) *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runList(ctx context.Context, dockerCli command.Cli, container string, opts listOptions) error {
|
||||
checkpoints, err := dockerCli.Client().CheckpointList(ctx, container, client.CheckpointListOptions{
|
||||
func runList(ctx context.Context, dockerCLI command.Cli, container string, opts listOptions) error {
|
||||
checkpoints, err := dockerCLI.Client().CheckpointList(ctx, container, client.CheckpointListOptions{
|
||||
CheckpointDir: opts.checkpointDir,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -45,8 +45,8 @@ func runList(ctx context.Context, dockerCli command.Cli, container string, opts
|
||||
}
|
||||
|
||||
cpCtx := formatter.Context{
|
||||
Output: dockerCli.Out(),
|
||||
Output: dockerCLI.Out(),
|
||||
Format: newFormat(formatter.TableFormatKey),
|
||||
}
|
||||
return formatWrite(cpCtx, checkpoints)
|
||||
return formatWrite(cpCtx, checkpoints.Checkpoints)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
func TestCheckpointListErrors(t *testing.T) {
|
||||
testCases := []struct {
|
||||
args []string
|
||||
checkpointListFunc func(container string, options client.CheckpointListOptions) ([]checkpoint.Summary, error)
|
||||
checkpointListFunc func(container string, options client.CheckpointListOptions) (client.CheckpointListResult, error)
|
||||
expectedError string
|
||||
}{
|
||||
{
|
||||
@@ -29,8 +29,8 @@ func TestCheckpointListErrors(t *testing.T) {
|
||||
},
|
||||
{
|
||||
args: []string{"foo"},
|
||||
checkpointListFunc: func(container string, options client.CheckpointListOptions) ([]checkpoint.Summary, error) {
|
||||
return []checkpoint.Summary{}, errors.New("error getting checkpoints for container foo")
|
||||
checkpointListFunc: func(container string, options client.CheckpointListOptions) (client.CheckpointListResult, error) {
|
||||
return client.CheckpointListResult{}, errors.New("error getting checkpoints for container foo")
|
||||
},
|
||||
expectedError: "error getting checkpoints for container foo",
|
||||
},
|
||||
@@ -51,11 +51,13 @@ func TestCheckpointListErrors(t *testing.T) {
|
||||
func TestCheckpointListWithOptions(t *testing.T) {
|
||||
var containerID, checkpointDir string
|
||||
cli := test.NewFakeCli(&fakeClient{
|
||||
checkpointListFunc: func(container string, options client.CheckpointListOptions) ([]checkpoint.Summary, error) {
|
||||
checkpointListFunc: func(container string, options client.CheckpointListOptions) (client.CheckpointListResult, error) {
|
||||
containerID = container
|
||||
checkpointDir = options.CheckpointDir
|
||||
return []checkpoint.Summary{
|
||||
{Name: "checkpoint-foo"},
|
||||
return client.CheckpointListResult{
|
||||
Checkpoints: []checkpoint.Summary{
|
||||
{Name: "checkpoint-foo"},
|
||||
},
|
||||
}, nil
|
||||
},
|
||||
})
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ require (
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/mattn/go-runewidth v0.0.17
|
||||
github.com/moby/go-archive v0.1.0
|
||||
github.com/moby/moby/api v1.52.0-beta.1.0.20250923190348-e98849831fc4 // master
|
||||
github.com/moby/moby/client v0.1.0-beta.0.0.20250923190348-e98849831fc4 // master
|
||||
github.com/moby/moby/api v1.52.0-beta.1.0.20250929144731-9a97f59e6e2d // master
|
||||
github.com/moby/moby/client v0.1.0-beta.0.0.20250929144731-9a97f59e6e2d // master
|
||||
github.com/moby/patternmatcher v0.6.0
|
||||
github.com/moby/swarmkit/v2 v2.1.0
|
||||
github.com/moby/sys/atomicwriter v0.1.0
|
||||
|
||||
+4
-4
@@ -170,10 +170,10 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
|
||||
github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
|
||||
github.com/moby/moby/api v1.52.0-beta.1.0.20250923190348-e98849831fc4 h1:nwVKjkAlQJp32lsr/TZ4dGUIkj+Ga6ftle+IVov9HYs=
|
||||
github.com/moby/moby/api v1.52.0-beta.1.0.20250923190348-e98849831fc4/go.mod h1:8sBV0soUREiudtow4vqJGOxa4GyHI5vLQmvgKdHq5Ok=
|
||||
github.com/moby/moby/client v0.1.0-beta.0.0.20250923190348-e98849831fc4 h1:fk0TcJJf4rrgD3I35xxPkb9R4S+KCToMNomydm/n2Pg=
|
||||
github.com/moby/moby/client v0.1.0-beta.0.0.20250923190348-e98849831fc4/go.mod h1:o5CkJu0RlmnLWRZRaEd7fL6wo0Ggr8Hw/UvgqdIUBuI=
|
||||
github.com/moby/moby/api v1.52.0-beta.1.0.20250929144731-9a97f59e6e2d h1:Aj0cTKlIyJh8hg5veIvuQEBQgFLtGJ5CJ9qqOV3TOpc=
|
||||
github.com/moby/moby/api v1.52.0-beta.1.0.20250929144731-9a97f59e6e2d/go.mod h1:8sBV0soUREiudtow4vqJGOxa4GyHI5vLQmvgKdHq5Ok=
|
||||
github.com/moby/moby/client v0.1.0-beta.0.0.20250929144731-9a97f59e6e2d h1:sDDi6SlfhB2ld+fsS3+6rWxLwUL4+++on61QPLAgvtY=
|
||||
github.com/moby/moby/client v0.1.0-beta.0.0.20250929144731-9a97f59e6e2d/go.mod h1:o5CkJu0RlmnLWRZRaEd7fL6wo0Ggr8Hw/UvgqdIUBuI=
|
||||
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
|
||||
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
||||
github.com/moby/swarmkit/v2 v2.1.0 h1:u+cJ5hSyF3HnzsyI+NtegYxdIPQIuibk7IbpXNxuISM=
|
||||
|
||||
+7
-1
@@ -134,7 +134,13 @@ type InspectResponse struct {
|
||||
AppArmorProfile string
|
||||
ExecIDs []string
|
||||
HostConfig *HostConfig
|
||||
GraphDriver storage.DriverData
|
||||
|
||||
// GraphDriver contains information about the container's graph driver.
|
||||
GraphDriver *storage.DriverData `json:"GraphDriver,omitempty"`
|
||||
|
||||
// Storage contains information about the storage used for the container's filesystem.
|
||||
Storage *storage.Storage `json:"Storage,omitempty"`
|
||||
|
||||
SizeRw *int64 `json:",omitempty"`
|
||||
SizeRootFs *int64 `json:",omitempty"`
|
||||
Mounts []MountPoint
|
||||
|
||||
-5
@@ -24,11 +24,6 @@ type AuthConfig struct {
|
||||
Password string `json:"password,omitempty"`
|
||||
Auth string `json:"auth,omitempty"`
|
||||
|
||||
// Email is an optional value associated with the username.
|
||||
//
|
||||
// Deprecated: This field is deprecated since docker 1.11 (API v1.23) and will be removed in the next release.
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
ServerAddress string `json:"serveraddress,omitempty"`
|
||||
|
||||
// IdentityToken is used to authenticate the user and get
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package storage
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// RootFSStorage Information about the storage used for the container's root filesystem.
|
||||
//
|
||||
// swagger:model RootFSStorage
|
||||
type RootFSStorage struct {
|
||||
|
||||
// Information about the snapshot used for the container's root filesystem.
|
||||
//
|
||||
Snapshot *RootFSStorageSnapshot `json:"Snapshot,omitempty"`
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package storage
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// RootFSStorageSnapshot Information about a snapshot backend of the container's root filesystem.
|
||||
//
|
||||
// swagger:model RootFSStorageSnapshot
|
||||
type RootFSStorageSnapshot struct {
|
||||
|
||||
// Name of the snapshotter.
|
||||
Name string `json:"Name,omitempty"`
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package storage
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// Storage Information about the storage used by the container.
|
||||
//
|
||||
// swagger:model Storage
|
||||
type Storage struct {
|
||||
|
||||
// Information about the storage used for the container's root filesystem.
|
||||
//
|
||||
RootFS *RootFSStorage `json:"RootFS,omitempty"`
|
||||
}
|
||||
+1
-3
@@ -2,8 +2,6 @@ package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/moby/moby/api/types/checkpoint"
|
||||
)
|
||||
|
||||
// CheckpointAPIClient defines API client methods for the checkpoints.
|
||||
@@ -14,5 +12,5 @@ import (
|
||||
type CheckpointAPIClient interface {
|
||||
CheckpointCreate(ctx context.Context, container string, options CheckpointCreateOptions) error
|
||||
CheckpointDelete(ctx context.Context, container string, options CheckpointDeleteOptions) error
|
||||
CheckpointList(ctx context.Context, container string, options CheckpointListOptions) ([]checkpoint.Summary, error)
|
||||
CheckpointList(ctx context.Context, container string, options CheckpointListOptions) (CheckpointListResult, error)
|
||||
}
|
||||
|
||||
+10
-5
@@ -13,9 +13,14 @@ type CheckpointListOptions struct {
|
||||
CheckpointDir string
|
||||
}
|
||||
|
||||
// CheckpointListResult holds the result from the CheckpointList method.
|
||||
type CheckpointListResult struct {
|
||||
Checkpoints []checkpoint.Summary
|
||||
}
|
||||
|
||||
// CheckpointList returns the checkpoints of the given container in the docker host.
|
||||
func (cli *Client) CheckpointList(ctx context.Context, container string, options CheckpointListOptions) ([]checkpoint.Summary, error) {
|
||||
var checkpoints []checkpoint.Summary
|
||||
func (cli *Client) CheckpointList(ctx context.Context, container string, options CheckpointListOptions) (CheckpointListResult, error) {
|
||||
var out CheckpointListResult
|
||||
|
||||
query := url.Values{}
|
||||
if options.CheckpointDir != "" {
|
||||
@@ -25,9 +30,9 @@ func (cli *Client) CheckpointList(ctx context.Context, container string, options
|
||||
resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return checkpoints, err
|
||||
return out, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.Body).Decode(&checkpoints)
|
||||
return checkpoints, err
|
||||
err = json.NewDecoder(resp.Body).Decode(&out.Checkpoints)
|
||||
return out, err
|
||||
}
|
||||
|
||||
+19
-1
@@ -149,7 +149,25 @@ func (cli *Client) doRequest(req *http.Request) (*http.Response, error) {
|
||||
return nil, errConnectionFailed{fmt.Errorf("%w.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err)}
|
||||
}
|
||||
|
||||
if cli.scheme == "https" && strings.Contains(err.Error(), "bad certificate") {
|
||||
const (
|
||||
// Go 1.25 / TLS 1.3 may produce a generic "handshake failure"
|
||||
// whereas TLS 1.2 may produce a "bad certificate" TLS alert.
|
||||
// See https://github.com/golang/go/issues/56371
|
||||
//
|
||||
// > https://tip.golang.org/doc/go1.12#tls_1_3
|
||||
// >
|
||||
// > In TLS 1.3 the client is the last one to speak in the handshake, so if
|
||||
// > it causes an error to occur on the server, it will be returned on the
|
||||
// > client by the first Read, not by Handshake. For example, that will be
|
||||
// > the case if the server rejects the client certificate.
|
||||
//
|
||||
// https://github.com/golang/go/blob/go1.25.1/src/crypto/tls/alert.go#L71-L72
|
||||
alertBadCertificate = "bad certificate" // go1.24 / TLS 1.2
|
||||
alertHandshakeFailure = "handshake failure" // go1.25 / TLS 1.3
|
||||
)
|
||||
|
||||
// TODO(thaJeztah): see if we can use errors.As for a [crypto/tls.AlertError] instead of bare string matching.
|
||||
if cli.scheme == "https" && (strings.Contains(err.Error(), alertHandshakeFailure) || strings.Contains(err.Error(), alertBadCertificate)) {
|
||||
return nil, errConnectionFailed{fmt.Errorf("the server probably has client authentication (--tlsverify) enabled; check your TLS client certification settings: %w", err)}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -168,7 +168,7 @@ github.com/moby/docker-image-spec/specs-go/v1
|
||||
github.com/moby/go-archive
|
||||
github.com/moby/go-archive/compression
|
||||
github.com/moby/go-archive/tarheader
|
||||
# github.com/moby/moby/api v1.52.0-beta.1.0.20250923190348-e98849831fc4
|
||||
# github.com/moby/moby/api v1.52.0-beta.1.0.20250929144731-9a97f59e6e2d
|
||||
## explicit; go 1.23.0
|
||||
github.com/moby/moby/api/pkg/authconfig
|
||||
github.com/moby/moby/api/pkg/progress
|
||||
@@ -194,7 +194,7 @@ github.com/moby/moby/api/types/swarm
|
||||
github.com/moby/moby/api/types/system
|
||||
github.com/moby/moby/api/types/versions
|
||||
github.com/moby/moby/api/types/volume
|
||||
# github.com/moby/moby/client v0.1.0-beta.0.0.20250923190348-e98849831fc4
|
||||
# github.com/moby/moby/client v0.1.0-beta.0.0.20250929144731-9a97f59e6e2d
|
||||
## explicit; go 1.23.0
|
||||
github.com/moby/moby/client
|
||||
github.com/moby/moby/client/internal/timestamp
|
||||
|
||||
Reference in New Issue
Block a user