Skip to content

Commit d2371c0

Browse files
committed
vendor: github.com/moby/moby/api v1.52.0-beta.3, moby/client master
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 4612c81 commit d2371c0

File tree

15 files changed

+86
-50
lines changed

15 files changed

+86
-50
lines changed

cli-plugins/plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func withPluginClientConn(name string) command.CLIOption {
139139
if err != nil {
140140
return err
141141
}
142-
apiClient, err := client.NewClientWithOpts(client.WithDialContext(helper.Dialer))
142+
apiClient, err := client.New(client.WithDialContext(helper.Dialer))
143143
if err != nil {
144144
return err
145145
}

cli/command/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func newAPIClientFromEndpoint(ep docker.Endpoint, configFile *configfile.ConfigF
316316
opts = append(opts, withCustomHeaders)
317317
}
318318
opts = append(opts, extraOpts...)
319-
return client.NewClientWithOpts(opts...)
319+
return client.New(opts...)
320320
}
321321

322322
func resolveDockerEndpoint(s store.Reader, contextName string) (docker.Endpoint, error) {

cli/command/cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ func TestNewDockerCliAndOperators(t *testing.T) {
292292
func TestInitializeShouldAlwaysCreateTheContextStore(t *testing.T) {
293293
cli, err := NewDockerCli()
294294
assert.NilError(t, err)
295-
apiClient, err := client.NewClientWithOpts()
295+
apiClient, err := client.New()
296296
assert.NilError(t, err)
297297
assert.NilError(t, cli.Initialize(flags.NewClientOptions(), WithAPIClient(apiClient)))
298298
assert.Check(t, cli.ContextStore() != nil)

cli/command/context/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func getDockerEndpoint(contextStore store.Reader, config map[string]string) (doc
123123
return docker.Endpoint{}, fmt.Errorf("invalid docker endpoint options: %w", err)
124124
}
125125
// FIXME(thaJeztah): this creates a new client (but discards it) only to validate the options; are the validation steps above not enough?
126-
if _, err := client.NewClientWithOpts(opts...); err != nil {
126+
if _, err := client.New(opts...); err != nil {
127127
return docker.Endpoint{}, fmt.Errorf("unable to apply docker endpoint options: %w", err)
128128
}
129129
return ep, nil

cli/command/stack/client_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"strings"
66

77
"github.com/docker/cli/cli/compose/convert"
8-
"github.com/moby/moby/api/types"
98
"github.com/moby/moby/api/types/network"
109
"github.com/moby/moby/api/types/swarm"
1110
"github.com/moby/moby/client"
@@ -38,9 +37,8 @@ type fakeClient struct {
3837
configRemoveFunc func(configID string) (client.ConfigRemoveResult, error)
3938
}
4039

41-
func (*fakeClient) ServerVersion(context.Context) (types.Version, error) {
42-
return types.Version{
43-
Version: "docker-dev",
40+
func (*fakeClient) ServerVersion(context.Context, client.ServerVersionOptions) (client.ServerVersionResult, error) {
41+
return client.ServerVersionResult{
4442
APIVersion: client.MaxAPIVersion,
4543
}, nil
4644
}

cli/command/system/client_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package system
33
import (
44
"context"
55

6-
"github.com/moby/moby/api/types"
76
"github.com/moby/moby/api/types/container"
87
"github.com/moby/moby/api/types/events"
98
"github.com/moby/moby/client"
@@ -21,7 +20,7 @@ type fakeClient struct {
2120
networkListFunc func(ctx context.Context, options client.NetworkListOptions) (client.NetworkListResult, error)
2221
networkPruneFunc func(ctx context.Context, options client.NetworkPruneOptions) (client.NetworkPruneResult, error)
2322
nodeListFunc func(ctx context.Context, options client.NodeListOptions) (client.NodeListResult, error)
24-
serverVersion func(ctx context.Context) (types.Version, error)
23+
serverVersion func(ctx context.Context, options client.ServerVersionOptions) (client.ServerVersionResult, error)
2524
volumeListFunc func(ctx context.Context, options client.VolumeListOptions) (client.VolumeListResult, error)
2625
}
2726

@@ -89,8 +88,8 @@ func (cli *fakeClient) NodeList(ctx context.Context, options client.NodeListOpti
8988
return client.NodeListResult{}, nil
9089
}
9190

92-
func (cli *fakeClient) ServerVersion(ctx context.Context) (types.Version, error) {
93-
return cli.serverVersion(ctx)
91+
func (cli *fakeClient) ServerVersion(ctx context.Context, options client.ServerVersionOptions) (client.ServerVersionResult, error) {
92+
return cli.serverVersion(ctx, options)
9493
}
9594

9695
func (cli *fakeClient) VolumeList(ctx context.Context, options client.VolumeListOptions) (client.VolumeListResult, error) {

cli/command/system/version.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"io"
77
"runtime"
88
"sort"
9-
"strconv"
109
"text/template"
1110
"time"
1211

@@ -64,7 +63,7 @@ type versionOptions struct {
6463
// versionInfo contains version information of both the Client, and Server
6564
type versionInfo struct {
6665
Client clientVersion
67-
Server *types.Version
66+
Server *client.ServerVersionResult
6867
}
6968

7069
type platformInfo struct {
@@ -153,12 +152,10 @@ func runVersion(ctx context.Context, dockerCli command.Cli, opts *versionOptions
153152
return cli.StatusError{StatusCode: 64, Status: err.Error()}
154153
}
155154

156-
// TODO print error if kubernetes is used?
157-
158155
vd := versionInfo{
159156
Client: newClientVersion(dockerCli.CurrentContext(), dockerCli),
160157
}
161-
sv, err := dockerCli.Client().ServerVersion(ctx)
158+
sv, err := dockerCli.Client().ServerVersion(ctx, client.ServerVersionOptions{})
162159
if err == nil {
163160
vd.Server = &sv
164161
foundEngine := false
@@ -175,16 +172,10 @@ func runVersion(ctx context.Context, dockerCli command.Cli, opts *versionOptions
175172
if !foundEngine {
176173
vd.Server.Components = append(vd.Server.Components, types.ComponentVersion{
177174
Name: "Engine",
178-
Version: sv.Version,
175+
Version: "unknown",
179176
Details: map[string]string{
180177
"ApiVersion": sv.APIVersion,
181178
"MinAPIVersion": sv.MinAPIVersion,
182-
"GitCommit": sv.GitCommit,
183-
"GoVersion": sv.GoVersion,
184-
"Os": sv.Os,
185-
"Arch": sv.Arch,
186-
"BuildTime": reformatDate(vd.Server.BuildTime),
187-
"Experimental": strconv.FormatBool(sv.Experimental),
188179
},
189180
})
190181
}

cli/command/system/version_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import (
1010

1111
"github.com/docker/cli/internal/test"
1212
"github.com/moby/moby/api/types"
13+
"github.com/moby/moby/client"
1314
"gotest.tools/v3/assert"
1415
is "gotest.tools/v3/assert/cmp"
1516
"gotest.tools/v3/golden"
1617
)
1718

1819
func TestVersionWithoutServer(t *testing.T) {
1920
cli := test.NewFakeCli(&fakeClient{
20-
serverVersion: func(ctx context.Context) (types.Version, error) {
21-
return types.Version{}, errors.New("no server")
21+
serverVersion: func(ctx context.Context, options client.ServerVersionOptions) (client.ServerVersionResult, error) {
22+
return client.ServerVersionResult{}, errors.New("no server")
2223
},
2324
})
2425
cmd := newVersionCommand(cli)
@@ -46,8 +47,8 @@ func TestVersionFormat(t *testing.T) {
4647
BuildTime: "Wed May 30 22:21:05 2018",
4748
Context: "my-context",
4849
},
49-
Server: &types.Version{
50-
Platform: struct{ Name string }{Name: "Docker Enterprise Edition (EE) 2.0"},
50+
Server: &client.ServerVersionResult{
51+
Platform: client.PlatformInfo{Name: "Docker Enterprise Edition (EE) 2.0"},
5152
Components: []types.ComponentVersion{
5253
{
5354
Name: "Engine",

vendor.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ require (
2828
github.com/google/uuid v1.6.0
2929
github.com/mattn/go-runewidth v0.0.17
3030
github.com/moby/go-archive v0.1.0
31-
github.com/moby/moby/api v1.52.0-beta.2.0.20251029225139-7a97e1cb401f // master
32-
github.com/moby/moby/client v0.1.0-beta.2.0.20251029225139-7a97e1cb401f // master
31+
github.com/moby/moby/api v1.52.0-beta.3
32+
github.com/moby/moby/client v0.1.0-beta.2.0.20251030172346-72f6cec1257d // master
3333
github.com/moby/patternmatcher v0.6.0
3434
github.com/moby/swarmkit/v2 v2.1.0
3535
github.com/moby/sys/atomicwriter v0.1.0

vendor.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N
170170
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
171171
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
172172
github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
173-
github.com/moby/moby/api v1.52.0-beta.2.0.20251029225139-7a97e1cb401f h1:agkZxo7k3fXBqdq6leYCCv0K45OjkH/H3fzPjwcoDkY=
174-
github.com/moby/moby/api v1.52.0-beta.2.0.20251029225139-7a97e1cb401f/go.mod h1:v0K/motq8oWmx+rtApG1rBTIpQ8KUONUjpf+U73gags=
175-
github.com/moby/moby/client v0.1.0-beta.2.0.20251029225139-7a97e1cb401f h1:I0uikdmKsCbOxQV+DIn7gyY8bD0d19g8920FuxI9l3E=
176-
github.com/moby/moby/client v0.1.0-beta.2.0.20251029225139-7a97e1cb401f/go.mod h1:1YrJTvhL771Q4xiwwe72NSS17lgsCF67xu8fEfSd77g=
173+
github.com/moby/moby/api v1.52.0-beta.3 h1:EG7cqrIcA5HzXFJIHuEKEHQM/J2B08OfoVFWFeyqYBM=
174+
github.com/moby/moby/api v1.52.0-beta.3/go.mod h1:v0K/motq8oWmx+rtApG1rBTIpQ8KUONUjpf+U73gags=
175+
github.com/moby/moby/client v0.1.0-beta.2.0.20251030172346-72f6cec1257d h1:aFsGjFnVmqS9lUbT8Xfo1pOnCD1a/Px7LN1MFBaUdgQ=
176+
github.com/moby/moby/client v0.1.0-beta.2.0.20251030172346-72f6cec1257d/go.mod h1:1YrJTvhL771Q4xiwwe72NSS17lgsCF67xu8fEfSd77g=
177177
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
178178
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
179179
github.com/moby/swarmkit/v2 v2.1.0 h1:u+cJ5hSyF3HnzsyI+NtegYxdIPQIuibk7IbpXNxuISM=

0 commit comments

Comments
 (0)