Files
moby/daemon
Kay Yan 3b9269760c Fix conversion of restart-policy from GRPC
restart-condition for services from "on_failure" to "on-failure".

Since GRPC does not support dashes in properties, this change
added a conversion when _setting_ the restart-condition.

However, when inspecting a service, no conversion took place
from the internal GRPC value, resulting in "on_failure" to
be shown.

This change updates the conversion to fix this, and removes
a "hack" that was previously used for this, now using a
Switch to compare to actual types.

Before this change:

    docker service create --name web --restart-condition=on-failure nginx:alpine

    docker service inspect --format '{{ json .Spec.TaskTemplate.RestartPolicy }}' web
    {"Condition":"on_failure","MaxAttempts":0}

Afer this change:

    docker service create --name web --restart-condition=on-failure nginx:alpine

    docker service inspect --format '{{ json .Spec.TaskTemplate.RestartPolicy }}' web
    {"Condition":"on-failure","MaxAttempts":0}

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
(cherry picked from commit bc32fcabeb)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 13:24:32 -07:00
..
2016-06-13 22:16:18 -07:00
2016-05-06 16:08:53 -07:00
2016-07-25 23:18:15 -07:00
2016-07-25 23:15:42 -07:00
2016-07-25 23:18:15 -07:00
2016-07-08 15:32:14 -07:00
2016-06-30 16:47:52 -07:00
2016-06-30 16:47:52 -07:00
2016-07-25 23:18:15 -07:00
2016-06-30 16:47:43 -07:00
2016-06-02 19:12:20 -07:00