From ea5f53782ad64b735621d5ca6c1c592a6a423e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Verdo=C3=AFa=20Laurent?= Date: Fri, 26 Feb 2016 12:38:31 +0900 Subject: [PATCH] provider/docker: #2417 Add support for restart policy unless-stopped --- builtin/providers/docker/resource_docker_container.go | 4 ++-- .../source/docs/providers/docker/r/container.html.markdown | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/providers/docker/resource_docker_container.go b/builtin/providers/docker/resource_docker_container.go index 28e142305..74e75882c 100644 --- a/builtin/providers/docker/resource_docker_container.go +++ b/builtin/providers/docker/resource_docker_container.go @@ -101,9 +101,9 @@ func resourceDockerContainer() *schema.Resource { Default: "no", ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { value := v.(string) - if !regexp.MustCompile(`^(no|on-failure|always)$`).MatchString(value) { + if !regexp.MustCompile(`^(no|on-failure|always|unless-stopped)$`).MatchString(value) { es = append(es, fmt.Errorf( - "%q must be one of \"no\", \"on-failure\", or \"always\"", k)) + "%q must be one of \"no\", \"on-failure\", \"always\" or \"unless-stopped\"", k)) } return }, diff --git a/website/source/docs/providers/docker/r/container.html.markdown b/website/source/docs/providers/docker/r/container.html.markdown index a60b06bf7..582e8b492 100644 --- a/website/source/docs/providers/docker/r/container.html.markdown +++ b/website/source/docs/providers/docker/r/container.html.markdown @@ -51,7 +51,7 @@ The following arguments are supported: * `hostname` - (Optional, string) Hostname of the container. * `domainname` - (Optional, string) Domain name of the container. * `restart` - (Optional, string) The restart policy for the container. Must be - one of "no", "on-failure", "always". + one of "no", "on-failure", "always", "unless-stopped". * `max_retry_count` - (Optional, int) The maximum amount of times to an attempt a restart when `restart` is set to "on-failure" * `must_run` - (Optional, bool) If true, then the Docker container will be