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/convert
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
..
container.go Use newer default values for mounts CLI 2016-07-08 15:32:30 -07:00
network.go Check if DriverState is valid before using in convert 2016-06-17 13:09:12 -07:00
node.go Replace secrets with join tokens 2016-07-25 23:16:59 -07:00
service.go Fix conversion of restart-policy from GRPC 2016-10-20 13:24:32 -07:00
swarm.go Remove join-tokens from the /info API 2016-07-27 12:10:49 -07:00
task.go swarm: add log driver support for services 2016-07-25 23:15:25 -07:00