Skip to content

Commit cdf705c

Browse files
committed
vendor: github.com/moby/moby/api, github.com/moby/moby/client master
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent f40caed commit cdf705c

File tree

20 files changed

+96
-85
lines changed

20 files changed

+96
-85
lines changed

cli/command/container/attach_test.go

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ func TestNewAttachCommandErrors(t *testing.T) {
3232
expectedError: "cannot attach to a stopped container",
3333
containerInspectFunc: func(containerID string) (container.InspectResponse, error) {
3434
return container.InspectResponse{
35-
ContainerJSONBase: &container.ContainerJSONBase{
36-
State: &container.State{
37-
Running: false,
38-
},
35+
State: &container.State{
36+
Running: false,
3937
},
4038
}, nil
4139
},
@@ -46,11 +44,9 @@ func TestNewAttachCommandErrors(t *testing.T) {
4644
expectedError: "cannot attach to a paused container",
4745
containerInspectFunc: func(containerID string) (container.InspectResponse, error) {
4846
return container.InspectResponse{
49-
ContainerJSONBase: &container.ContainerJSONBase{
50-
State: &container.State{
51-
Running: true,
52-
Paused: true,
53-
},
47+
State: &container.State{
48+
Running: true,
49+
Paused: true,
5450
},
5551
}, nil
5652
},
@@ -61,12 +57,10 @@ func TestNewAttachCommandErrors(t *testing.T) {
6157
expectedError: "cannot attach to a restarting container",
6258
containerInspectFunc: func(containerID string) (container.InspectResponse, error) {
6359
return container.InspectResponse{
64-
ContainerJSONBase: &container.ContainerJSONBase{
65-
State: &container.State{
66-
Running: true,
67-
Paused: false,
68-
Restarting: true,
69-
},
60+
State: &container.State{
61+
Running: true,
62+
Paused: false,
63+
Restarting: true,
7064
},
7165
}, nil
7266
},

cli/command/container/logs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ var logFn = func(expectedOut string) func(string, container.LogsOptions) (io.Rea
2121
func TestRunLogs(t *testing.T) {
2222
inspectFn := func(containerID string) (container.InspectResponse, error) {
2323
return container.InspectResponse{
24-
Config: &container.Config{Tty: true},
25-
ContainerJSONBase: &container.ContainerJSONBase{State: &container.State{Running: false}},
24+
Config: &container.Config{Tty: true},
25+
State: &container.State{Running: false},
2626
}, nil
2727
}
2828

cli/command/network/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
type fakeClient struct {
1212
client.Client
13-
networkCreateFunc func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
13+
networkCreateFunc func(ctx context.Context, name string, options client.NetworkCreateOptions) (network.CreateResponse, error)
1414
networkConnectFunc func(ctx context.Context, networkID, container string, config *network.EndpointSettings) error
1515
networkDisconnectFunc func(ctx context.Context, networkID, container string, force bool) error
1616
networkRemoveFunc func(ctx context.Context, networkID string) error
@@ -19,7 +19,7 @@ type fakeClient struct {
1919
networkInspectFunc func(ctx context.Context, networkID string, options client.NetworkInspectOptions) (network.Inspect, []byte, error)
2020
}
2121

22-
func (c *fakeClient) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) {
22+
func (c *fakeClient) NetworkCreate(ctx context.Context, name string, options client.NetworkCreateOptions) (network.CreateResponse, error) {
2323
if c.networkCreateFunc != nil {
2424
return c.networkCreateFunc(ctx, name, options)
2525
}

cli/command/network/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func runCreate(ctx context.Context, apiClient client.NetworkAPIClient, output io
113113
Network: options.configFrom,
114114
}
115115
}
116-
resp, err := apiClient.NetworkCreate(ctx, options.name, network.CreateOptions{
116+
resp, err := apiClient.NetworkCreate(ctx, options.name, client.NetworkCreateOptions{
117117
Driver: options.driver,
118118
Options: options.driverOpts.GetAll(),
119119
IPAM: ipamCfg,

cli/command/network/create_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"github.com/docker/cli/internal/test"
1111
"github.com/moby/moby/api/types/network"
12+
"github.com/moby/moby/client"
1213
"gotest.tools/v3/assert"
1314
is "gotest.tools/v3/assert/cmp"
1415
)
@@ -17,15 +18,15 @@ func TestNetworkCreateErrors(t *testing.T) {
1718
testCases := []struct {
1819
args []string
1920
flags map[string]string
20-
networkCreateFunc func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
21+
networkCreateFunc func(ctx context.Context, name string, options client.NetworkCreateOptions) (network.CreateResponse, error)
2122
expectedError string
2223
}{
2324
{
2425
expectedError: "1 argument",
2526
},
2627
{
2728
args: []string{"toto"},
28-
networkCreateFunc: func(ctx context.Context, name string, createBody network.CreateOptions) (network.CreateResponse, error) {
29+
networkCreateFunc: func(ctx context.Context, name string, createBody client.NetworkCreateOptions) (network.CreateResponse, error) {
2930
return network.CreateResponse{}, errors.New("error creating network")
3031
},
3132
expectedError: "error creating network",
@@ -162,7 +163,7 @@ func TestNetworkCreateWithFlags(t *testing.T) {
162163
},
163164
}
164165
cli := test.NewFakeCli(&fakeClient{
165-
networkCreateFunc: func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) {
166+
networkCreateFunc: func(ctx context.Context, name string, options client.NetworkCreateOptions) (network.CreateResponse, error) {
166167
assert.Check(t, is.Equal(expectedDriver, options.Driver), "not expected driver error")
167168
assert.Check(t, is.DeepEqual(expectedOpts, options.IPAM.Config), "not expected driver error")
168169
return network.CreateResponse{
@@ -220,7 +221,7 @@ func TestNetworkCreateIPv4(t *testing.T) {
220221
for _, tc := range tests {
221222
t.Run(tc.doc, func(t *testing.T) {
222223
cli := test.NewFakeCli(&fakeClient{
223-
networkCreateFunc: func(ctx context.Context, name string, createBody network.CreateOptions) (network.CreateResponse, error) {
224+
networkCreateFunc: func(ctx context.Context, name string, createBody client.NetworkCreateOptions) (network.CreateResponse, error) {
224225
assert.Check(t, is.DeepEqual(createBody.EnableIPv4, tc.expected))
225226
return network.CreateResponse{ID: name}, nil
226227
},
@@ -274,7 +275,7 @@ func TestNetworkCreateIPv6(t *testing.T) {
274275
for _, tc := range tests {
275276
t.Run(tc.doc, func(t *testing.T) {
276277
cli := test.NewFakeCli(&fakeClient{
277-
networkCreateFunc: func(ctx context.Context, name string, createBody network.CreateOptions) (network.CreateResponse, error) {
278+
networkCreateFunc: func(ctx context.Context, name string, createBody client.NetworkCreateOptions) (network.CreateResponse, error) {
278279
assert.Check(t, is.DeepEqual(tc.expected, createBody.EnableIPv6))
279280
return network.CreateResponse{ID: name}, nil
280281
},

cli/command/stack/swarm/deploy_composefile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func createConfigs(ctx context.Context, dockerCLI command.Cli, configs []swarm.C
156156
return nil
157157
}
158158

159-
func createNetworks(ctx context.Context, dockerCLI command.Cli, namespace convert.Namespace, networks map[string]network.CreateOptions) error {
159+
func createNetworks(ctx context.Context, dockerCLI command.Cli, namespace convert.Namespace, networks map[string]client.NetworkCreateOptions) error {
160160
apiClient := dockerCLI.Client()
161161

162162
existingNetworks, err := getStackNetworks(ctx, apiClient, namespace.Name())

cli/compose/convert/compose.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
composetypes "github.com/docker/cli/cli/compose/types"
88
"github.com/moby/moby/api/types/network"
99
"github.com/moby/moby/api/types/swarm"
10+
"github.com/moby/moby/client"
1011
)
1112

1213
const (
@@ -51,21 +52,21 @@ func AddStackLabel(namespace Namespace, labels map[string]string) map[string]str
5152
type networkMap map[string]composetypes.NetworkConfig
5253

5354
// Networks from the compose-file type to the engine API type
54-
func Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]network.CreateOptions, []string) {
55+
func Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]client.NetworkCreateOptions, []string) {
5556
if networks == nil {
5657
networks = make(map[string]composetypes.NetworkConfig)
5758
}
5859

5960
externalNetworks := []string{}
60-
result := make(map[string]network.CreateOptions)
61+
result := make(map[string]client.NetworkCreateOptions)
6162
for internalName := range servicesNetworks {
6263
nw := networks[internalName]
6364
if nw.External.External {
6465
externalNetworks = append(externalNetworks, nw.Name)
6566
continue
6667
}
6768

68-
createOpts := network.CreateOptions{
69+
createOpts := client.NetworkCreateOptions{
6970
Labels: AddStackLabel(namespace, nw.Labels),
7071
Driver: nw.Driver,
7172
Options: nw.DriverOpts,

cli/compose/convert/compose_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
composetypes "github.com/docker/cli/cli/compose/types"
77
"github.com/moby/moby/api/types/network"
8+
"github.com/moby/moby/client"
89
"gotest.tools/v3/assert"
910
is "gotest.tools/v3/assert/cmp"
1011
"gotest.tools/v3/fs"
@@ -76,7 +77,7 @@ func TestNetworks(t *testing.T) {
7677
Name: "othername",
7778
},
7879
}
79-
expected := map[string]network.CreateOptions{
80+
expected := map[string]client.NetworkCreateOptions{
8081
"foo_default": {
8182
Labels: map[string]string{
8283
LabelNamespace: "foo",

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.16
3030
github.com/moby/go-archive v0.1.0
31-
github.com/moby/moby/api v1.52.0-alpha.1.0.20250826224528-62884141100c // master
32-
github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c // master
31+
github.com/moby/moby/api v1.52.0-alpha.1.0.20250827142737-8ac1bfa6c554 // master
32+
github.com/moby/moby/client v0.1.0-alpha.0.0.20250827142737-8ac1bfa6c554 // master
3333
github.com/moby/patternmatcher v0.6.0
3434
github.com/moby/swarmkit/v2 v2.0.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-alpha.1.0.20250826224528-62884141100c h1:AcG4SepExP6gSs565xPaCqlmEq0uDHKE1rYvnvVPCKk=
174-
github.com/moby/moby/api v1.52.0-alpha.1.0.20250826224528-62884141100c/go.mod h1:8sBV0soUREiudtow4vqJGOxa4GyHI5vLQmvgKdHq5Ok=
175-
github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c h1:+O0DPAuYz+gqyPLChsGdFUIR2ujMlyJcTchS5PDdrYU=
176-
github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c/go.mod h1:7pOYrEHdG7I0dNZEC+yqk/p8ZOxGMR1KgoexzCEDe0w=
173+
github.com/moby/moby/api v1.52.0-alpha.1.0.20250827142737-8ac1bfa6c554 h1:N6U77C4Lro2uqDeBGP4Zz3UIHjaQst8E45P9vOeUY7E=
174+
github.com/moby/moby/api v1.52.0-alpha.1.0.20250827142737-8ac1bfa6c554/go.mod h1:8sBV0soUREiudtow4vqJGOxa4GyHI5vLQmvgKdHq5Ok=
175+
github.com/moby/moby/client v0.1.0-alpha.0.0.20250827142737-8ac1bfa6c554 h1:8Vd0p/2rVqjnyQxUbcaox9uVhbgxr9axxfSWdpq1KXc=
176+
github.com/moby/moby/client v0.1.0-alpha.0.0.20250827142737-8ac1bfa6c554/go.mod h1:7pOYrEHdG7I0dNZEC+yqk/p8ZOxGMR1KgoexzCEDe0w=
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.0.0 h1:jkWQKQaJ4ltA61/mC9UdPe1McLma55RUcacTO+pPweY=

0 commit comments

Comments
 (0)