Merge pull request #5337 from lvjp/b-docker-container-restart
provider/docker: #2417 Add support for restart policy unless-stopped
This commit is contained in:
commit
cc0c07e93a
|
@ -101,9 +101,9 @@ func resourceDockerContainer() *schema.Resource {
|
||||||
Default: "no",
|
Default: "no",
|
||||||
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
|
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
|
||||||
value := v.(string)
|
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(
|
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
|
return
|
||||||
},
|
},
|
||||||
|
|
|
@ -51,7 +51,7 @@ The following arguments are supported:
|
||||||
* `hostname` - (Optional, string) Hostname of the container.
|
* `hostname` - (Optional, string) Hostname of the container.
|
||||||
* `domainname` - (Optional, string) Domain name of the container.
|
* `domainname` - (Optional, string) Domain name of the container.
|
||||||
* `restart` - (Optional, string) The restart policy for the container. Must be
|
* `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
|
* `max_retry_count` - (Optional, int) The maximum amount of times to an attempt
|
||||||
a restart when `restart` is set to "on-failure"
|
a restart when `restart` is set to "on-failure"
|
||||||
* `must_run` - (Optional, bool) If true, then the Docker container will be
|
* `must_run` - (Optional, bool) If true, then the Docker container will be
|
||||||
|
|
Loading…
Reference in New Issue