Merge component 'engine' from git@github.com:moby/moby master
This commit is contained in:
@ -340,6 +340,11 @@ func (d *Driver) Remove(id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetLayerPath gets the layer path on host
|
||||
func (d *Driver) GetLayerPath(id string) (string, error) {
|
||||
return d.dir(id), nil
|
||||
}
|
||||
|
||||
// Get returns the rootfs path for the id. This will mount the dir at its given path.
|
||||
func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
||||
logrus.Debugf("WindowsGraphDriver Get() id %s mountLabel %s", id, mountLabel)
|
||||
|
||||
@ -46,7 +46,7 @@ func TestCreateFailsWhenIdentifierDoesNotExist(t *testing.T) {
|
||||
&container.Config{Image: tc.image},
|
||||
&container.HostConfig{},
|
||||
&network.NetworkingConfig{},
|
||||
"foo",
|
||||
"",
|
||||
)
|
||||
testutil.ErrorContains(t, err, tc.expectedError)
|
||||
})
|
||||
@ -86,7 +86,7 @@ func TestCreateWithInvalidEnv(t *testing.T) {
|
||||
},
|
||||
&container.HostConfig{},
|
||||
&network.NetworkingConfig{},
|
||||
"foo",
|
||||
"",
|
||||
)
|
||||
testutil.ErrorContains(t, err, tc.expectedError)
|
||||
})
|
||||
|
||||
@ -7,7 +7,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
containerTypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/integration/internal/container"
|
||||
"github.com/docker/docker/integration/internal/request"
|
||||
@ -70,15 +69,10 @@ func TestExportContainerAfterDaemonRestart(t *testing.T) {
|
||||
defer d.Stop(t)
|
||||
|
||||
ctx := context.Background()
|
||||
cfg := containerTypes.Config{
|
||||
Image: "busybox",
|
||||
Cmd: []string{"top"},
|
||||
}
|
||||
ctr, err := client.ContainerCreate(ctx, &cfg, nil, nil, "")
|
||||
assert.NilError(t, err)
|
||||
ctrID := container.Create(t, ctx, client)
|
||||
|
||||
d.Restart(t)
|
||||
|
||||
_, err = client.ContainerExport(ctx, ctr.ID)
|
||||
_, err = client.ContainerExport(ctx, ctrID)
|
||||
assert.NilError(t, err)
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/integration/internal/container"
|
||||
"github.com/docker/docker/internal/test/daemon"
|
||||
|
||||
"github.com/gotestyourself/gotestyourself/assert"
|
||||
@ -40,25 +40,17 @@ func TestCgroupDriverSystemdMemoryLimit(t *testing.T) {
|
||||
defer d.Stop(t)
|
||||
|
||||
const mem = 64 * 1024 * 1024 // 64 MB
|
||||
cfg := container.Config{
|
||||
Image: "busybox",
|
||||
Cmd: []string{"top"},
|
||||
}
|
||||
hostcfg := container.HostConfig{
|
||||
Resources: container.Resources{
|
||||
Memory: mem,
|
||||
},
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
ctr, err := client.ContainerCreate(ctx, &cfg, &hostcfg, nil, "")
|
||||
assert.NilError(t, err)
|
||||
defer client.ContainerRemove(ctx, ctr.ID, types.ContainerRemoveOptions{Force: true})
|
||||
ctrID := container.Create(t, ctx, client, func(c *container.TestContainerConfig) {
|
||||
c.HostConfig.Resources.Memory = mem
|
||||
})
|
||||
defer client.ContainerRemove(ctx, ctrID, types.ContainerRemoveOptions{Force: true})
|
||||
|
||||
err = client.ContainerStart(ctx, ctr.ID, types.ContainerStartOptions{})
|
||||
err = client.ContainerStart(ctx, ctrID, types.ContainerStartOptions{})
|
||||
assert.NilError(t, err)
|
||||
|
||||
s, err := client.ContainerInspect(ctx, ctr.ID)
|
||||
s, err := client.ContainerInspect(ctx, ctrID)
|
||||
assert.NilError(t, err)
|
||||
assert.Equal(t, s.HostConfig.Memory, mem)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user