Commit Graph

9 Commits

Author SHA1 Message Date
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