1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon
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
..
caps
cluster Fix conversion of restart-policy from GRPC 2016-10-20 13:24:32 -07:00
events Make daemon events listen for plugin lifecycle events. 2016-08-11 17:56:43 -07:00
exec
graphdriver Add retry logic during aufs unmount. 2016-09-26 19:35:12 -07:00
links
logger
network
apparmor_default.go
apparmor_default_unsupported.go
archive.go
archive_unix.go
archive_windows.go
attach.go
auth.go
changes.go
commit.go
config.go
config_experimental.go
config_solaris.go
config_stub.go
config_test.go
config_unix.go
config_windows.go
container.go
container_operations.go
container_operations_solaris.go
container_operations_unix.go
container_operations_windows.go
create.go
create_unix.go
create_windows.go
daemon.go add lock in libcontainerd client AddProcess of Windows 2016-10-20 11:38:36 -07:00
daemon_experimental.go Make daemon events listen for plugin lifecycle events. 2016-08-11 17:56:43 -07:00
daemon_linux.go
daemon_linux_test.go
daemon_solaris.go
daemon_stub.go Make daemon events listen for plugin lifecycle events. 2016-08-11 17:56:43 -07:00
daemon_test.go
daemon_unix.go
daemon_unix_test.go
daemon_unsupported.go
daemon_windows.go
debugtrap_unix.go
debugtrap_unsupported.go
debugtrap_windows.go
delete.go
delete_test.go
discovery.go
discovery_test.go
errors.go
events.go Make daemon events listen for plugin lifecycle events. 2016-08-11 17:56:43 -07:00
events_test.go
exec.go
exec_linux.go
exec_solaris.go
exec_windows.go
export.go
health.go Reset health status to starting when a container is restarted 2016-10-20 11:36:43 -07:00
health_test.go
image.go
image_delete.go
image_exporter.go
image_history.go
image_inspect.go
image_pull.go
image_push.go
image_tag.go
images.go
import.go
info.go
inspect.go
inspect_solaris.go
inspect_unix.go
inspect_windows.go
keys.go
keys_unsupported.go
kill.go
links.go
links_test.go
list.go Check for non-nil container after match 2016-09-26 19:33:23 -07:00
list_unix.go
list_windows.go
logdrivers_linux.go
logdrivers_windows.go
logs.go
logs_test.go
monitor.go
monitor_linux.go
monitor_solaris.go
monitor_windows.go
mounts.go
names.go
network.go
oci_linux.go
oci_solaris.go
oci_windows.go
pause.go
rename.go
resize.go
restart.go
search.go
search_test.go
seccomp_disabled.go
seccomp_linux.go
seccomp_unsupported.go
selinux_linux.go
selinux_unsupported.go
start.go Remove the support of setting host configuration options when the container starts 2016-09-26 19:33:58 -07:00
start_linux.go
start_windows.go
stats.go
stats_collector_solaris.go
stats_collector_unix.go
stats_collector_windows.go
stop.go
top_unix.go
top_unix_test.go
top_windows.go
unpause.go
update.go
update_linux.go
update_solaris.go
update_windows.go
volumes.go
volumes_unit_test.go
volumes_unix.go
volumes_windows.go
wait.go