Merge component 'engine' from git@github.com:docker/engine master
This commit is contained in:
@@ -149,7 +149,7 @@ func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc {
|
||||
}
|
||||
|
||||
// InitRouter initializes the list of routers for the server.
|
||||
// This method also enables the Go profiler if enableProfiler is true.
|
||||
// This method also enables the Go profiler.
|
||||
func (s *Server) InitRouter(routers ...router.Router) {
|
||||
s.routers = append(s.routers, routers...)
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ func WithInternal() func(*types.NetworkCreate) {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAttachable sets Attachable flag on the create network request
|
||||
func WithAttachable() func(*types.NetworkCreate) {
|
||||
return func(n *types.NetworkCreate) {
|
||||
n.Attachable = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithMacvlan sets the network as macvlan with the specified parent
|
||||
func WithMacvlan(parent string) func(*types.NetworkCreate) {
|
||||
return func(n *types.NetworkCreate) {
|
||||
|
||||
@@ -66,7 +66,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) {
|
||||
assert.Equal(t, out.IPAM.Config[0].Subnet, "175.30.0.0/16")
|
||||
|
||||
// Create a bridge network and verify its subnet is the second default pool
|
||||
name := "elango"
|
||||
name := "elango" + t.Name()
|
||||
network.CreateNoError(t, context.Background(), cli, name,
|
||||
network.WithDriver("bridge"),
|
||||
)
|
||||
@@ -75,7 +75,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) {
|
||||
assert.Equal(t, out.IPAM.Config[0].Subnet, "175.33.0.0/24")
|
||||
|
||||
// Create a bridge network and verify its subnet is the third default pool
|
||||
name = "saanvi"
|
||||
name = "saanvi" + t.Name()
|
||||
network.CreateNoError(t, context.Background(), cli, name,
|
||||
network.WithDriver("bridge"),
|
||||
)
|
||||
@@ -99,7 +99,7 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) {
|
||||
defer cli.Close()
|
||||
|
||||
// Create a bridge network
|
||||
name := "elango"
|
||||
name := "elango" + t.Name()
|
||||
network.CreateNoError(t, context.Background(), cli, name,
|
||||
network.WithDriver("bridge"),
|
||||
)
|
||||
@@ -131,7 +131,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
|
||||
defer cli.Close()
|
||||
|
||||
// Create a bridge network
|
||||
name := "elango"
|
||||
name := "elango" + t.Name()
|
||||
network.CreateNoError(t, context.Background(), cli, name,
|
||||
network.WithDriver("bridge"),
|
||||
)
|
||||
@@ -140,7 +140,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
|
||||
networkip := out.IPAM.Config[0].Subnet
|
||||
|
||||
// Create a bridge network
|
||||
name = "sthira"
|
||||
name = "sthira" + t.Name()
|
||||
network.CreateNoError(t, context.Background(), cli, name,
|
||||
network.WithDriver("bridge"),
|
||||
)
|
||||
@@ -154,7 +154,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
|
||||
"--default-address-pool", "base=175.19.0.0/16,size=24")
|
||||
|
||||
// Create a bridge network
|
||||
name = "saanvi"
|
||||
name = "saanvi" + t.Name()
|
||||
network.CreateNoError(t, context.Background(), cli, name,
|
||||
network.WithDriver("bridge"),
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/docker/integration/internal/container"
|
||||
net "github.com/docker/docker/integration/internal/network"
|
||||
"github.com/docker/docker/integration/internal/swarm"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
@@ -21,11 +22,10 @@ func TestDockerNetworkConnectAlias(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
name := t.Name() + "test-alias"
|
||||
_, err := client.NetworkCreate(ctx, name, types.NetworkCreate{
|
||||
Driver: "overlay",
|
||||
Attachable: true,
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
net.CreateNoError(t, ctx, client, name,
|
||||
net.WithDriver("overlay"),
|
||||
net.WithAttachable(),
|
||||
)
|
||||
|
||||
cID1 := container.Create(t, ctx, client, func(c *container.TestContainerConfig) {
|
||||
c.NetworkingConfig = &network.NetworkingConfig{
|
||||
@@ -35,7 +35,7 @@ func TestDockerNetworkConnectAlias(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
err = client.NetworkConnect(ctx, name, cID1, &network.EndpointSettings{
|
||||
err := client.NetworkConnect(ctx, name, cID1, &network.EndpointSettings{
|
||||
Aliases: []string{
|
||||
"aaa",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user