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/container
Sebastiaan van Stijn 0bce64f08d
api: POST /containers/{id}/wait: fix validation for "condition" parameter
commit 737e8c6ab8 added validation for the wait
condition parameter, however, the default ("not-running") option was not part
of the list of valid options, resulting in a regression if the default value
was explicitly passed;

    docker scan --accept-license --version
    Error response from daemon: invalid condition: "not-running"

This patch adds the missing option, and adds a test to verify.

With this patch;

    make BIND_DIR=. DOCKER_GRAPHDRIVER=vfs TEST_FILTER=TestWaitConditions test-integration
    ...
    --- PASS: TestWaitConditions (0.04s)
    --- PASS: TestWaitConditions/removed (1.79s)
    --- PASS: TestWaitConditions/default (1.91s)
    --- PASS: TestWaitConditions/next-exit (1.97s)
    --- PASS: TestWaitConditions/not-running (1.99s)
    PASS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-27 14:45:32 +02:00
..
backend.go container/exec: Support ConsoleSize 2022-06-24 11:54:25 +02:00
container.go api/server/httputils: add ReadJSON() utility 2022-04-11 21:37:51 +02:00
container_routes.go api: POST /containers/{id}/wait: fix validation for "condition" parameter 2022-06-27 14:45:32 +02:00
copy.go api/server/httputils: add ReadJSON() utility 2022-04-11 21:37:51 +02:00
exec.go container/exec: Support ConsoleSize 2022-06-24 11:54:25 +02:00
inspect.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00