moby--moby/daemon/cluster/convert
Kay Yan bc32fcabeb 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>
2016-09-30 15:54:47 +08:00
..
container.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
network.go Add support for docker run in swarm mode overlay 2016-09-07 21:20:41 -07:00
node.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
service.go Fix conversion of restart-policy from GRPC 2016-09-30 15:54:47 +08:00
swarm.go Let swarmkit handle cluster defaults in `swarm init` if not specified 2016-09-27 04:19:38 -07:00
task.go Fix partial/full filter issue in `service tasks --filter` 2016-09-26 16:01:20 -07:00