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
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
..
backend/build builder: add prune options to the API 2018-09-01 22:01:17 +00:00
httputils Replace deprecated grpc.ErrorDesc() and grpc.Code() calls 2018-12-30 12:34:28 +01:00
middleware api/server, dockerversion: modify context key 2018-08-22 11:20:22 +09:00
router Fix container update resetting pidslimit on older API clients 2019-02-24 16:32:32 +01:00
middleware.go Add canonical import comment 2018-02-05 16:51:57 -05:00
router_swapper.go Add canonical import comment 2018-02-05 16:51:57 -05:00
server.go Rely on request.Context() cancellation 2018-11-27 17:06:31 -08:00
server_test.go Various code-cleanup 2018-05-23 17:50:54 +02:00