Skip to content

Commit 7ae9f27

Browse files
authored
Merge pull request docker#5130 from thaJeztah/bump_engine
vendor: github.com/docker/docker 59996a493cfc (v27.0.0-dev)
2 parents 482bf86 + 97b7746 commit 7ae9f27

File tree

19 files changed

+123
-97
lines changed

19 files changed

+123
-97
lines changed

cli/command/network/client_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@ package network
33
import (
44
"context"
55

6-
"github.com/docker/docker/api/types"
76
"github.com/docker/docker/api/types/filters"
87
"github.com/docker/docker/api/types/network"
98
"github.com/docker/docker/client"
109
)
1110

1211
type fakeClient struct {
1312
client.Client
14-
networkCreateFunc func(ctx context.Context, name string, options types.NetworkCreate) (network.CreateResponse, error)
13+
networkCreateFunc func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
1514
networkConnectFunc func(ctx context.Context, networkID, container string, config *network.EndpointSettings) error
1615
networkDisconnectFunc func(ctx context.Context, networkID, container string, force bool) error
1716
networkRemoveFunc func(ctx context.Context, networkID string) error
1817
networkListFunc func(ctx context.Context, options network.ListOptions) ([]network.Summary, error)
19-
networkPruneFunc func(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error)
18+
networkPruneFunc func(ctx context.Context, pruneFilters filters.Args) (network.PruneReport, error)
2019
networkInspectFunc func(ctx context.Context, networkID string, options network.InspectOptions) (network.Inspect, []byte, error)
2120
}
2221

23-
func (c *fakeClient) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (network.CreateResponse, error) {
22+
func (c *fakeClient) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) {
2423
if c.networkCreateFunc != nil {
2524
return c.networkCreateFunc(ctx, name, options)
2625
}
@@ -62,9 +61,9 @@ func (c *fakeClient) NetworkInspectWithRaw(ctx context.Context, networkID string
6261
return network.Inspect{}, nil, nil
6362
}
6463

65-
func (c *fakeClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) {
64+
func (c *fakeClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error) {
6665
if c.networkPruneFunc != nil {
6766
return c.networkPruneFunc(ctx, pruneFilter)
6867
}
69-
return types.NetworksPruneReport{}, nil
68+
return network.PruneReport{}, nil
7069
}

cli/command/network/create.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/docker/cli/cli/command"
1111
"github.com/docker/cli/cli/command/completion"
1212
"github.com/docker/cli/opts"
13-
"github.com/docker/docker/api/types"
1413
"github.com/docker/docker/api/types/network"
1514
"github.com/pkg/errors"
1615
"github.com/spf13/cobra"
@@ -104,7 +103,7 @@ func runCreate(ctx context.Context, dockerCli command.Cli, options createOptions
104103
Network: options.configFrom,
105104
}
106105
}
107-
resp, err := client.NetworkCreate(ctx, options.name, types.NetworkCreate{
106+
resp, err := client.NetworkCreate(ctx, options.name, network.CreateOptions{
108107
Driver: options.driver,
109108
Options: options.driverOpts.GetAll(),
110109
IPAM: &network.IPAM{

cli/command/network/create_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"testing"
88

99
"github.com/docker/cli/internal/test"
10-
"github.com/docker/docker/api/types"
1110
"github.com/docker/docker/api/types/network"
1211
"github.com/pkg/errors"
1312
"gotest.tools/v3/assert"
@@ -18,15 +17,15 @@ func TestNetworkCreateErrors(t *testing.T) {
1817
testCases := []struct {
1918
args []string
2019
flags map[string]string
21-
networkCreateFunc func(ctx context.Context, name string, options types.NetworkCreate) (network.CreateResponse, error)
20+
networkCreateFunc func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
2221
expectedError string
2322
}{
2423
{
2524
expectedError: "exactly 1 argument",
2625
},
2726
{
2827
args: []string{"toto"},
29-
networkCreateFunc: func(ctx context.Context, name string, createBody types.NetworkCreate) (network.CreateResponse, error) {
28+
networkCreateFunc: func(ctx context.Context, name string, createBody network.CreateOptions) (network.CreateResponse, error) {
3029
return network.CreateResponse{}, errors.Errorf("error creating network")
3130
},
3231
expectedError: "error creating network",
@@ -153,9 +152,9 @@ func TestNetworkCreateWithFlags(t *testing.T) {
153152
},
154153
}
155154
cli := test.NewFakeCli(&fakeClient{
156-
networkCreateFunc: func(ctx context.Context, name string, createBody types.NetworkCreate) (network.CreateResponse, error) {
157-
assert.Check(t, is.Equal(expectedDriver, createBody.Driver), "not expected driver error")
158-
assert.Check(t, is.DeepEqual(expectedOpts, createBody.IPAM.Config), "not expected driver error")
155+
networkCreateFunc: func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) {
156+
assert.Check(t, is.Equal(expectedDriver, options.Driver), "not expected driver error")
157+
assert.Check(t, is.DeepEqual(expectedOpts, options.IPAM.Config), "not expected driver error")
159158
return network.CreateResponse{
160159
ID: name,
161160
}, nil
@@ -212,7 +211,7 @@ func TestNetworkCreateIPv6(t *testing.T) {
212211
tc := tc
213212
t.Run(tc.doc, func(t *testing.T) {
214213
cli := test.NewFakeCli(&fakeClient{
215-
networkCreateFunc: func(ctx context.Context, name string, createBody types.NetworkCreate) (network.CreateResponse, error) {
214+
networkCreateFunc: func(ctx context.Context, name string, createBody network.CreateOptions) (network.CreateResponse, error) {
216215
assert.Check(t, is.DeepEqual(tc.expected, createBody.EnableIPv6))
217216
return network.CreateResponse{ID: name}, nil
218217
},

cli/command/network/prune_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"testing"
66

77
"github.com/docker/cli/internal/test"
8-
"github.com/docker/docker/api/types"
98
"github.com/docker/docker/api/types/filters"
9+
"github.com/docker/docker/api/types/network"
1010
"github.com/pkg/errors"
1111
)
1212

@@ -15,8 +15,8 @@ func TestNetworkPrunePromptTermination(t *testing.T) {
1515
t.Cleanup(cancel)
1616

1717
cli := test.NewFakeCli(&fakeClient{
18-
networkPruneFunc: func(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error) {
19-
return types.NetworksPruneReport{}, errors.New("fakeClient networkPruneFunc should not be called")
18+
networkPruneFunc: func(ctx context.Context, pruneFilters filters.Args) (network.PruneReport, error) {
19+
return network.PruneReport{}, errors.New("fakeClient networkPruneFunc should not be called")
2020
},
2121
})
2222
cmd := NewPruneCommand(cli)

cli/command/stack/swarm/deploy_composefile.go

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

160-
func createNetworks(ctx context.Context, dockerCli command.Cli, namespace convert.Namespace, networks map[string]types.NetworkCreate) error {
160+
func createNetworks(ctx context.Context, dockerCli command.Cli, namespace convert.Namespace, networks map[string]network.CreateOptions) error {
161161
client := dockerCli.Client()
162162

163163
existingNetworks, err := getStackNetworks(ctx, client, namespace.Name())

cli/command/system/client_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/docker/docker/api/types"
77
"github.com/docker/docker/api/types/events"
88
"github.com/docker/docker/api/types/filters"
9+
"github.com/docker/docker/api/types/network"
910
"github.com/docker/docker/client"
1011
)
1112

@@ -16,7 +17,7 @@ type fakeClient struct {
1617
serverVersion func(ctx context.Context) (types.Version, error)
1718
eventsFn func(context.Context, types.EventsOptions) (<-chan events.Message, <-chan error)
1819
containerPruneFunc func(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error)
19-
networkPruneFunc func(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error)
20+
networkPruneFunc func(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error)
2021
}
2122

2223
func (cli *fakeClient) ServerVersion(ctx context.Context) (types.Version, error) {
@@ -38,9 +39,9 @@ func (cli *fakeClient) ContainersPrune(ctx context.Context, pruneFilters filters
3839
return types.ContainersPruneReport{}, nil
3940
}
4041

41-
func (cli *fakeClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) {
42+
func (cli *fakeClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error) {
4243
if cli.networkPruneFunc != nil {
4344
return cli.networkPruneFunc(ctx, pruneFilter)
4445
}
45-
return types.NetworksPruneReport{}, nil
46+
return network.PruneReport{}, nil
4647
}

cli/command/system/prune_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/docker/cli/internal/test"
99
"github.com/docker/docker/api/types"
1010
"github.com/docker/docker/api/types/filters"
11+
"github.com/docker/docker/api/types/network"
1112
"github.com/pkg/errors"
1213
"gotest.tools/v3/assert"
1314
is "gotest.tools/v3/assert/cmp"
@@ -62,8 +63,8 @@ func TestSystemPrunePromptTermination(t *testing.T) {
6263
containerPruneFunc: func(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) {
6364
return types.ContainersPruneReport{}, errors.New("fakeClient containerPruneFunc should not be called")
6465
},
65-
networkPruneFunc: func(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error) {
66-
return types.NetworksPruneReport{}, errors.New("fakeClient networkPruneFunc should not be called")
66+
networkPruneFunc: func(ctx context.Context, pruneFilters filters.Args) (network.PruneReport, error) {
67+
return network.PruneReport{}, errors.New("fakeClient networkPruneFunc should not be called")
6768
},
6869
})
6970

cli/compose/convert/compose.go

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import (
55
"strings"
66

77
composetypes "github.com/docker/cli/cli/compose/types"
8-
"github.com/docker/docker/api/types"
9-
networktypes "github.com/docker/docker/api/types/network"
8+
"github.com/docker/docker/api/types/network"
109
"github.com/docker/docker/api/types/swarm"
1110
)
1211

@@ -52,45 +51,45 @@ func AddStackLabel(namespace Namespace, labels map[string]string) map[string]str
5251
type networkMap map[string]composetypes.NetworkConfig
5352

5453
// Networks from the compose-file type to the engine API type
55-
func Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]types.NetworkCreate, []string) {
54+
func Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]network.CreateOptions, []string) {
5655
if networks == nil {
5756
networks = make(map[string]composetypes.NetworkConfig)
5857
}
5958

6059
externalNetworks := []string{}
61-
result := make(map[string]types.NetworkCreate)
60+
result := make(map[string]network.CreateOptions)
6261
for internalName := range servicesNetworks {
63-
network := networks[internalName]
64-
if network.External.External {
65-
externalNetworks = append(externalNetworks, network.Name)
62+
nw := networks[internalName]
63+
if nw.External.External {
64+
externalNetworks = append(externalNetworks, nw.Name)
6665
continue
6766
}
6867

69-
createOpts := types.NetworkCreate{
70-
Labels: AddStackLabel(namespace, network.Labels),
71-
Driver: network.Driver,
72-
Options: network.DriverOpts,
73-
Internal: network.Internal,
74-
Attachable: network.Attachable,
68+
createOpts := network.CreateOptions{
69+
Labels: AddStackLabel(namespace, nw.Labels),
70+
Driver: nw.Driver,
71+
Options: nw.DriverOpts,
72+
Internal: nw.Internal,
73+
Attachable: nw.Attachable,
7574
}
7675

77-
if network.Ipam.Driver != "" || len(network.Ipam.Config) > 0 {
78-
createOpts.IPAM = &networktypes.IPAM{}
76+
if nw.Ipam.Driver != "" || len(nw.Ipam.Config) > 0 {
77+
createOpts.IPAM = &network.IPAM{}
7978
}
8079

81-
if network.Ipam.Driver != "" {
82-
createOpts.IPAM.Driver = network.Ipam.Driver
80+
if nw.Ipam.Driver != "" {
81+
createOpts.IPAM.Driver = nw.Ipam.Driver
8382
}
84-
for _, ipamConfig := range network.Ipam.Config {
85-
config := networktypes.IPAMConfig{
83+
for _, ipamConfig := range nw.Ipam.Config {
84+
config := network.IPAMConfig{
8685
Subnet: ipamConfig.Subnet,
8786
}
8887
createOpts.IPAM.Config = append(createOpts.IPAM.Config, config)
8988
}
9089

9190
networkName := namespace.Scope(internalName)
92-
if network.Name != "" {
93-
networkName = network.Name
91+
if nw.Name != "" {
92+
networkName = nw.Name
9493
}
9594
result[networkName] = createOpts
9695
}

cli/compose/convert/compose_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"testing"
55

66
composetypes "github.com/docker/cli/cli/compose/types"
7-
"github.com/docker/docker/api/types"
87
"github.com/docker/docker/api/types/network"
98
"gotest.tools/v3/assert"
109
is "gotest.tools/v3/assert/cmp"
@@ -77,7 +76,7 @@ func TestNetworks(t *testing.T) {
7776
Name: "othername",
7877
},
7978
}
80-
expected := map[string]types.NetworkCreate{
79+
expected := map[string]network.CreateOptions{
8180
"foo_default": {
8281
Labels: map[string]string{
8382
LabelNamespace: "foo",

vendor.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/creack/pty v1.1.21
1313
github.com/distribution/reference v0.5.0
1414
github.com/docker/distribution v2.8.3+incompatible
15-
github.com/docker/docker v26.1.1-0.20240606182029-00f18ef7a455+incompatible // master (v27.0.0-dev)
15+
github.com/docker/docker v26.1.1-0.20240607121412-59996a493cfc+incompatible // master (v27.0.0-dev)
1616
github.com/docker/docker-credential-helpers v0.8.2
1717
github.com/docker/go-connections v0.5.0
1818
github.com/docker/go-units v0.5.0

vendor.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5
5959
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
6060
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
6161
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
62-
github.com/docker/docker v26.1.1-0.20240606182029-00f18ef7a455+incompatible h1:6OR7f7LuvJU27W400ctN0mxeAGDnPc0Fg2IGQhltKb0=
63-
github.com/docker/docker v26.1.1-0.20240606182029-00f18ef7a455+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
62+
github.com/docker/docker v26.1.1-0.20240607121412-59996a493cfc+incompatible h1:MQR7fZxS7agfjACehtep/M6Bvz7/pFvbOcFvtTmvKlg=
63+
github.com/docker/docker v26.1.1-0.20240607121412-59996a493cfc+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
6464
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
6565
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
6666
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

vendor/github.com/docker/docker/api/swagger.yaml

Lines changed: 16 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/api/types/network/network.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)