1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/cluster
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
..
convert Fix conversion of restart-policy from GRPC 2016-10-20 13:24:32 -07:00
executor Skip always pulling images on integration tests 2016-08-17 14:19:31 -07:00
provider Fix misspell typos 2016-06-30 16:47:43 -07:00
cluster.go cluster: Do not autodetect advertise address on join 2016-09-26 21:02:54 -07:00
filters.go Allow partial name match for node ls, and node tasks 2016-07-25 23:15:45 -07:00
helpers.go Fix spelling in comments, strings and documentation 2016-07-08 15:31:42 -07:00
listen_addr.go Better error messages when IP address autodetection fails 2016-08-11 17:56:44 -07:00