Skip to content

Commit

Permalink
adopt container.RestartPolicy*
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Dec 5, 2023
1 parent df1533a commit 8026d0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,15 @@ func mapRestartPolicyCondition(condition string) container.RestartPolicyMode {
// map definitions of deploy.restart_policy to engine definitions
switch condition {
case "none", "no":
return types.RestartPolicyNo
return container.RestartPolicyDisabled
case "on-failure":
return types.RestartPolicyOnFailure
return container.RestartPolicyOnFailure
case "unless-stopped":
return types.RestartPolicyUnlessStopped
return container.RestartPolicyUnlessStopped
case "any", "always":
return types.RestartPolicyAlways
return container.RestartPolicyAlways
default:
return types.RestartPolicyNo
return container.RestartPolicyMode(condition)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/compose/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func TestComposeService_Logs_ServiceFiltering(t *testing.T) {

type testLogConsumer struct {
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
}

Expand Down

0 comments on commit 8026d0e

Please sign in to comment.