Files
docker-cli/components/engine/daemon
Kay Yan 2062fd3e44 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>
Upstream-commit: bc32fcabebb5f3a83d47c00d85317ce82c963edf
Component: engine
2016-09-30 15:54:47 +08:00
..
2016-09-12 09:20:27 -07:00
2016-09-07 11:05:58 -07:00
2016-09-16 12:27:13 -04:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-08-25 13:09:04 -04:00
2016-09-16 12:27:13 -04:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-07-21 20:04:47 -07:00
2016-09-16 12:27:13 -04:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-28 13:42:27 -07:00
2016-09-07 11:05:58 -07:00
2016-09-28 14:10:15 +08:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-23 12:13:29 -07:00
2016-06-27 10:23:37 -07:00
2016-06-27 10:23:37 -07:00
2016-09-07 11:05:58 -07:00
2016-09-28 12:45:30 +02:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-28 14:10:15 +08:00
2016-09-13 09:55:35 -04:00
2016-09-27 14:49:17 +02:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-01 11:53:07 +02:00
2016-09-16 11:56:15 -07:00
2016-09-16 11:56:15 -07:00
2016-09-21 12:36:52 +02:00
2016-09-16 11:56:15 -07:00
2016-09-16 11:56:15 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00