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 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 Add engine-api types to docker 2016-09-07 11:05:58 -07:00
cluster.go Let swarmkit handle cluster defaults in swarm init if not specified 2016-09-27 04:19:38 -07:00
filters.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
helpers.go Fix spelling in comments, strings and documentation 2016-07-03 20:58:11 +03:00
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