Merge "Fix docker restart policy issue on docker engine 1.13"
This commit is contained in:
commit
ee2ce24eef
@ -523,10 +523,13 @@ class DockerWorker(object):
|
|||||||
if self.params.get('restart_policy') in ['on-failure',
|
if self.params.get('restart_policy') in ['on-failure',
|
||||||
'always',
|
'always',
|
||||||
'unless-stopped']:
|
'unless-stopped']:
|
||||||
options['restart_policy'] = {
|
policy = {'Name': self.params.get('restart_policy')}
|
||||||
'Name': self.params.get('restart_policy'),
|
# NOTE(Jeffrey4l): MaximumRetryCount is only needed for on-failure
|
||||||
'MaximumRetryCount': self.params.get('restart_retries')
|
# policy
|
||||||
}
|
if self.params.get('restart_policy') == 'on-failure':
|
||||||
|
retries = self.params.get('restart_retries')
|
||||||
|
policy['MaximumRetryCount'] = retries
|
||||||
|
options['restart_policy'] = policy
|
||||||
|
|
||||||
if binds:
|
if binds:
|
||||||
options['binds'] = binds
|
options['binds'] = binds
|
||||||
|
Loading…
Reference in New Issue
Block a user