mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client_(attach,commit,create,diff): Wrap result and options
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/Microsoft/go-winio"
|
||||
"github.com/moby/moby/api/types/container"
|
||||
"github.com/moby/moby/api/types/mount"
|
||||
"github.com/moby/moby/api/types/network"
|
||||
"github.com/moby/moby/client"
|
||||
"github.com/moby/moby/v2/internal/testutil"
|
||||
"github.com/pkg/errors"
|
||||
@@ -51,19 +52,23 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsBindNamedPipe(c *testing.T
|
||||
ctx := testutil.GetContext(c)
|
||||
apiClient := testEnv.APIClient()
|
||||
_, err = apiClient.ContainerCreate(ctx,
|
||||
&container.Config{
|
||||
Image: testEnv.PlatformDefaults.BaseImage,
|
||||
Cmd: []string{"cmd", "/c", cmd},
|
||||
}, &container.HostConfig{
|
||||
Mounts: []mount.Mount{
|
||||
{
|
||||
Type: "npipe",
|
||||
Source: hostPipeName,
|
||||
Target: containerPipeName,
|
||||
client.ContainerCreateOptions{
|
||||
Config: &container.Config{
|
||||
Image: testEnv.PlatformDefaults.BaseImage,
|
||||
Cmd: []string{"cmd", "/c", cmd},
|
||||
},
|
||||
HostConfig: &container.HostConfig{
|
||||
Mounts: []mount.Mount{
|
||||
{
|
||||
Type: "npipe",
|
||||
Source: hostPipeName,
|
||||
Target: containerPipeName,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
nil, nil, name)
|
||||
NetworkingConfig: &network.NetworkingConfig{},
|
||||
ContainerName: name,
|
||||
})
|
||||
assert.NilError(c, err)
|
||||
|
||||
err = apiClient.ContainerStart(ctx, name, client.ContainerStartOptions{})
|
||||
|
||||
Reference in New Issue
Block a user