moby--moby/daemon/cluster
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
..
convert Fix conversion of restart-policy from GRPC 2016-09-30 15:54:47 +08:00
executor Fix partial/full filter issue in `service tasks --filter` 2016-09-26 16:01:20 -07:00
provider
cluster.go Let swarmkit handle cluster defaults in `swarm init` if not specified 2016-09-27 04:19:38 -07:00
filters.go
helpers.go
listen_addr.go Add fallback to resolveSystemAddr() in linux 2016-09-09 13:27:57 -07:00
listen_addr_linux.go Add fallback to resolveSystemAddr() in linux 2016-09-09 13:27:57 -07:00
listen_addr_others.go Add fallback to resolveSystemAddr() in linux 2016-09-09 13:27:57 -07:00