mirror of
https://github.com/docker/compose.git
synced 2025-07-24 22:24:41 +02:00
adopt container.RestartPolicy*
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
df1533a1ca
commit
8026d0e2f2
@ -449,15 +449,15 @@ func mapRestartPolicyCondition(condition string) container.RestartPolicyMode {
|
|||||||
// map definitions of deploy.restart_policy to engine definitions
|
// map definitions of deploy.restart_policy to engine definitions
|
||||||
switch condition {
|
switch condition {
|
||||||
case "none", "no":
|
case "none", "no":
|
||||||
return types.RestartPolicyNo
|
return container.RestartPolicyDisabled
|
||||||
case "on-failure":
|
case "on-failure":
|
||||||
return types.RestartPolicyOnFailure
|
return container.RestartPolicyOnFailure
|
||||||
case "unless-stopped":
|
case "unless-stopped":
|
||||||
return types.RestartPolicyUnlessStopped
|
return container.RestartPolicyUnlessStopped
|
||||||
case "any", "always":
|
case "any", "always":
|
||||||
return types.RestartPolicyAlways
|
return container.RestartPolicyAlways
|
||||||
default:
|
default:
|
||||||
return types.RestartPolicyNo
|
return container.RestartPolicyMode(condition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ func TestComposeService_Logs_ServiceFiltering(t *testing.T) {
|
|||||||
|
|
||||||
type testLogConsumer struct {
|
type testLogConsumer struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
// logs is keyed containerType; values are log lines
|
// logs is keyed by container ID; values are log lines
|
||||||
logs map[string][]string
|
logs map[string][]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user