Skip to content

Commit c962084

Browse files
authored
Merge pull request #5754 from thaJeztah/bump_engine
vendor: github.com/docker/docker 6c3797923dcb (master, v28.0-dev)
2 parents 11999b1 + 01da8a5 commit c962084

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1258
-287
lines changed

cli/command/cli_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,16 @@ func TestNewAPIClientFromFlagsWithCustomHeadersFromEnv(t *testing.T) {
123123
}
124124

125125
func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
126-
customVersion := "v3.3.3"
126+
const customVersion = "v3.3.3"
127+
const expectedVersion = "3.3.3"
127128
t.Setenv("DOCKER_API_VERSION", customVersion)
128129
t.Setenv("DOCKER_HOST", ":2375")
129130

130131
opts := &flags.ClientOptions{}
131132
configFile := &configfile.ConfigFile{}
132133
apiclient, err := NewAPIClientFromFlags(opts, configFile)
133134
assert.NilError(t, err)
134-
assert.Equal(t, apiclient.ClientVersion(), customVersion)
135+
assert.Equal(t, apiclient.ClientVersion(), expectedVersion)
135136
}
136137

137138
type fakeClient struct {

cli/command/image/client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type fakeClient struct {
2424
imagesPruneFunc func(pruneFilter filters.Args) (image.PruneReport, error)
2525
imageLoadFunc func(input io.Reader, options image.LoadOptions) (image.LoadResponse, error)
2626
imageListFunc func(options image.ListOptions) ([]image.Summary, error)
27-
imageInspectFunc func(img string) (image.InspectResponse, []byte, error)
27+
imageInspectFunc func(img string) (image.InspectResponse, error)
2828
imageImportFunc func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)
2929
imageHistoryFunc func(img string, options image.HistoryOptions) ([]image.HistoryResponseItem, error)
3030
imageBuildFunc func(context.Context, io.Reader, types.ImageBuildOptions) (types.ImageBuildResponse, error)
@@ -95,11 +95,11 @@ func (cli *fakeClient) ImageList(_ context.Context, options image.ListOptions) (
9595
return []image.Summary{}, nil
9696
}
9797

98-
func (cli *fakeClient) ImageInspectWithRaw(_ context.Context, img string) (image.InspectResponse, []byte, error) {
98+
func (cli *fakeClient) ImageInspect(_ context.Context, img string, _ ...client.ImageInspectOption) (image.InspectResponse, error) {
9999
if cli.imageInspectFunc != nil {
100100
return cli.imageInspectFunc(img)
101101
}
102-
return image.InspectResponse{}, nil, nil
102+
return image.InspectResponse{}, nil
103103
}
104104

105105
func (cli *fakeClient) ImageImport(_ context.Context, source image.ImportSource, ref string,

cli/command/image/inspect.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
package image
55

66
import (
7+
"bytes"
78
"context"
89

910
"github.com/docker/cli/cli"
1011
"github.com/docker/cli/cli/command"
1112
"github.com/docker/cli/cli/command/completion"
1213
"github.com/docker/cli/cli/command/inspect"
1314
flagsHelper "github.com/docker/cli/cli/flags"
15+
"github.com/docker/docker/api/types/image"
16+
"github.com/docker/docker/client"
1417
"github.com/spf13/cobra"
1518
)
1619

@@ -42,6 +45,11 @@ func newInspectCommand(dockerCli command.Cli) *cobra.Command {
4245
func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {
4346
apiClient := dockerCLI.Client()
4447
return inspect.Inspect(dockerCLI.Out(), opts.refs, opts.format, func(ref string) (any, []byte, error) {
45-
return apiClient.ImageInspectWithRaw(ctx, ref)
48+
var buf bytes.Buffer
49+
resp, err := apiClient.ImageInspect(ctx, ref, client.ImageInspectWithRawResponse(&buf))
50+
if err != nil {
51+
return image.InspectResponse{}, nil, err
52+
}
53+
return resp, buf.Bytes(), err
4654
})
4755
}

cli/command/image/inspect_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,39 @@ func TestNewInspectCommandSuccess(t *testing.T) {
4141
name string
4242
args []string
4343
imageCount int
44-
imageInspectFunc func(img string) (image.InspectResponse, []byte, error)
44+
imageInspectFunc func(img string) (image.InspectResponse, error)
4545
}{
4646
{
4747
name: "simple",
4848
args: []string{"image"},
4949
imageCount: 1,
50-
imageInspectFunc: func(img string) (image.InspectResponse, []byte, error) {
50+
imageInspectFunc: func(img string) (image.InspectResponse, error) {
5151
imageInspectInvocationCount++
5252
assert.Check(t, is.Equal("image", img))
53-
return image.InspectResponse{}, nil, nil
53+
return image.InspectResponse{}, nil
5454
},
5555
},
5656
{
5757
name: "format",
5858
imageCount: 1,
5959
args: []string{"--format='{{.ID}}'", "image"},
60-
imageInspectFunc: func(img string) (image.InspectResponse, []byte, error) {
60+
imageInspectFunc: func(img string) (image.InspectResponse, error) {
6161
imageInspectInvocationCount++
62-
return image.InspectResponse{ID: img}, nil, nil
62+
return image.InspectResponse{ID: img}, nil
6363
},
6464
},
6565
{
6666
name: "simple-many",
6767
args: []string{"image1", "image2"},
6868
imageCount: 2,
69-
imageInspectFunc: func(img string) (image.InspectResponse, []byte, error) {
69+
imageInspectFunc: func(img string) (image.InspectResponse, error) {
7070
imageInspectInvocationCount++
7171
if imageInspectInvocationCount == 1 {
7272
assert.Check(t, is.Equal("image1", img))
7373
} else {
7474
assert.Check(t, is.Equal("image2", img))
7575
}
76-
return image.InspectResponse{}, nil, nil
76+
return image.InspectResponse{}, nil
7777
},
7878
},
7979
}

cli/command/system/inspect.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package system
55

66
import (
7+
"bytes"
78
"context"
89
"fmt"
910
"strings"
@@ -13,7 +14,9 @@ import (
1314
"github.com/docker/cli/cli/command/inspect"
1415
flagsHelper "github.com/docker/cli/cli/flags"
1516
"github.com/docker/docker/api/types"
17+
"github.com/docker/docker/api/types/image"
1618
"github.com/docker/docker/api/types/network"
19+
"github.com/docker/docker/client"
1720
"github.com/docker/docker/errdefs"
1821
"github.com/pkg/errors"
1922
"github.com/spf13/cobra"
@@ -67,7 +70,12 @@ func inspectContainers(ctx context.Context, dockerCli command.Cli, getSize bool)
6770

6871
func inspectImages(ctx context.Context, dockerCli command.Cli) inspect.GetRefFunc {
6972
return func(ref string) (any, []byte, error) {
70-
return dockerCli.Client().ImageInspectWithRaw(ctx, ref)
73+
var buf bytes.Buffer
74+
resp, err := dockerCli.Client().ImageInspect(ctx, ref, client.ImageInspectWithRawResponse(&buf))
75+
if err != nil {
76+
return image.InspectResponse{}, nil, err
77+
}
78+
return resp, buf.Bytes(), err
7179
}
7280
}
7381

cli/command/trust/inspect_pretty_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func (c *fakeClient) Info(context.Context) (system.Info, error) {
3232
return system.Info{}, nil
3333
}
3434

35-
func (c *fakeClient) ImageInspectWithRaw(context.Context, string) (image.InspectResponse, []byte, error) {
36-
return image.InspectResponse{}, []byte{}, nil
35+
func (c *fakeClient) ImageInspect(context.Context, string, ...client.ImageInspectOption) (image.InspectResponse, error) {
36+
return image.InspectResponse{}, nil
3737
}
3838

3939
func (c *fakeClient) ImagePush(context.Context, string, image.PushOptions) (io.ReadCloser, error) {

cli/command/trust/sign.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func validateTag(imgRefAndAuth trust.ImageRefAndAuth) error {
140140
}
141141

142142
func checkLocalImageExistence(ctx context.Context, apiClient client.APIClient, imageName string) error {
143-
_, _, err := apiClient.ImageInspectWithRaw(ctx, imageName)
143+
_, err := apiClient.ImageInspect(ctx, imageName)
144144
return err
145145
}
146146

cli/compose/convert/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func Services(
2828
ctx context.Context,
2929
namespace Namespace,
3030
config *composetypes.Config,
31-
apiClient client.CommonAPIClient,
31+
apiClient client.APIClient,
3232
) (map[string]swarm.ServiceSpec, error) {
3333
result := make(map[string]swarm.ServiceSpec)
3434
for _, service := range config.Services {

vendor.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/distribution/reference v0.6.0
1414
github.com/docker/cli-docs-tool v0.9.0
1515
github.com/docker/distribution v2.8.3+incompatible
16-
github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible // master (v-next)
16+
github.com/docker/docker v27.0.2-0.20250206180949-6c3797923dcb+incompatible // master (v-next)
1717
github.com/docker/docker-credential-helpers v0.8.2
1818
github.com/docker/go-connections v0.5.0
1919
github.com/docker/go-units v0.5.0

vendor.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3T
5151
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
5252
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
5353
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
54-
github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible h1:JqToo31hcYA8YAJwnaF1aq7WUhFRcMNPnkKCUzGFGJM=
55-
github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
54+
github.com/docker/docker v27.0.2-0.20250206180949-6c3797923dcb+incompatible h1:R6uFQLKwpUW5K3rRtO6PZ5Bhx4CsuiBla2lV+bZQT+Y=
55+
github.com/docker/docker v27.0.2-0.20250206180949-6c3797923dcb+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
5656
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
5757
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
5858
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

0 commit comments

Comments
 (0)