1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

15 commits

Author SHA1 Message Date
Vincent Demeester
d69d4799a3
Add a new request package in integration-cli
The goal is to remove function from `docker_utils.go` and setup
simple, one-responsability package that can be well tested ; and to
ease writing request.

This moves all the calls to `sockRequest` (and similar methods) to
their counterpart in the `request` package.

This introduce `request.Do` to write easier request (with functional
argument to easily augment the request) with some pre-defined function
for the most used http method (i.e. `request.Get`, `request.Post` and
`request.Delete`).

Few of the `sockRequest` call have been moved to `request.Do` (and
`Get`, etc.) to showcase the usage of the package. There is still a
whole lot to do.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-03 11:49:30 +01:00
Vincent Demeester
33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +01:00
Lei Jitang
737b5b1781 Fix update clear the restart policy of monitor
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-12-16 20:57:05 -05:00
Michael Crosby
91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Lei Jitang
92394785fa Fix update memory without memoryswap
The memory should always be smaller than memoryswap,
we should error out with message that user know how
to do rather than just an invalid argument error if
user update the memory limit bigger than already set
memory swap.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-08-08 18:36:03 +08:00
Qiang Huang
da5d66fb70 Fix TestUpdateKernelMemoryUninitialized on new kernel version
Fixes: #25073

Update kernel memory on running containers without initialized
is forbidden only on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-02 13:17:20 +08:00
Qiang Huang
08c7075c40 Soften limitation of update kernel memory
Kernel memory is not allowed to be updated if container is
running, it's not actually a precise kernel limitation.

Before kernel version 4.6, kernel memory will not be accounted
until kernel memory limit is set, if a container created with
kernel memory initialized, kernel memory is accounted as soon
as process created in container, so kernel memory limit update
is allowed afterward. If kernel memory is not initialized,
kernel memory consumed by processes in container will not be
accounted, so we can't update the limit because the account
will be wrong.

So update kernel memory of a running container with kernel memory
initialized is allowed, we should soften the limitation by docker.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-12 08:07:24 +08:00
Yuan Sun
16dfb38fb8 Add pause status check for --kernel-memory
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2016-04-01 10:32:46 +08:00
Qiang Huang
fa3b197157 Restore container configs when update failed
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-02-24 14:23:48 +08:00
Qiang Huang
8ae6f6ac28 Support update swap memory only
We should support update swap memory without memory.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-02-24 13:36:47 +08:00
Alexander Morozov
7a20a270bc Fix minor vet warnings
Also use Asserts where it's possible.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-02-03 10:43:01 -08:00
Zhang Wei
62a856e912 Assert error in body of function inspectField*
1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-29 23:39:07 +08:00
David Calavera
907407d0b2 Modify import paths to point to the new engine-api package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-06 19:48:59 -05:00
Lei Jitang
518ed75e1a Fix docker stats show wrong memory limit when do docker update
When a container create with -m 100m and then docker update other
cgroup settings such as --cpu-quota, the memory limit show by
docker stats will become the default value but not the 100m.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-12-29 20:33:16 -05:00
Qiang Huang
8799c4fc0f Implemet docker update command
It's used for updating properties of one or more containers, we only
support resource configs for now. It can be extended in the future.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-28 19:19:26 +08:00