1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/server/router
Sebastiaan van Stijn 5861a0db22
Fix container update resetting pidslimit on older API clients
Older API clients did not use a pointer for `PidsLimit`, so
API requests would always send `0`, resulting in any previous
value to be reset after an update:

Before this patch:

(using a 17.06 Docker CLI):

```bash
docker run -dit --name test --pids-limit=16 busybox
docker container inspect --format '{{json .HostConfig.PidsLimit}}' test
16

docker container update --memory=100M --memory-swap=200M test

docker container inspect --format '{{json .HostConfig.PidsLimit}}' test
0

docker container exec test cat /sys/fs/cgroup/pids/pids.max
max
```

With this patch applied:

(using a 17.06 Docker CLI):

```bash
docker run -dit --name test --pids-limit=16 busybox
docker container inspect --format '{{json .HostConfig.PidsLimit}}' test
16

docker container update --memory=100M --memory-swap=200M test

docker container inspect --format '{{json .HostConfig.PidsLimit}}' test
16

docker container exec test cat /sys/fs/cgroup/pids/pids.max
16
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-24 16:32:32 +01:00
..
build Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
checkpoint Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
container Fix container update resetting pidslimit on older API clients 2019-02-24 16:32:32 +01:00
debug Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
distribution Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
image Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
network Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
plugin Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
session move /session api endpoint out of experimental 2018-08-21 22:43:34 +00:00
swarm Use Runtime target 2019-02-19 13:14:17 -06:00
system Merge pull request #38609 from kwojcicki/enhancement/38518-docker_info_builder_version 2019-02-01 07:04:11 +08:00
volume Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
experimental.go fix typos 2018-09-01 21:26:38 +08:00
local.go Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
router.go Add canonical import comment 2018-02-05 16:51:57 -05:00