Skip to content

Commit

Permalink
Merge pull request #187 from h0tbird/restart_policy_unless-stopped
Browse files Browse the repository at this point in the history
Added new restart policy
  • Loading branch information
intjonathan authored Apr 16, 2018
2 parents e0e9111 + 5b8ed3a commit 2f292df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/centurion/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def build_host_config(restart_policy = nil)
host_config['RestartPolicy'] = {}

restart_policy_name = restart_policy.name
restart_policy_name = 'on-failure' unless ["always", "on-failure", "no"].include?(restart_policy_name)
restart_policy_name = 'on-failure' unless ["always", "on-failure", "no", "unless-stopped"].include?(restart_policy_name)

host_config['RestartPolicy']['Name'] = restart_policy_name
host_config['RestartPolicy']['MaximumRetryCount'] = restart_policy.max_retry_count || 10 if restart_policy_name == 'on-failure'
Expand Down

0 comments on commit 2f292df

Please sign in to comment.