Update docker module to avoid false positives when containers are first created. Also have the module check for api compatibility before trying to set a "--log-driver" option.

pull/18777/head
Ryan Walls 10 years ago committed by Matt Clay
parent f5c1d8141b
commit 9630972c2c

@ -1138,12 +1138,13 @@ class DockerManager(object):
# LOG_DRIVER # LOG_DRIVER
expected_log_driver = set(self.module.params.get('log_driver') or []) if self.ensure_capability('log_driver', false) :
actual_log_driver = set(container['HostConfig']['LogConfig']['Type'] or []) expected_log_driver = self.module.params.get('log_driver') or 'json-file'
if actual_log_driver != expected_log_driver: actual_log_driver = container['HostConfig']['LogConfig']['Type']
self.reload_reasons.append('log_driver ({0} => {1})'.format(actual_log_driver, expected_log_driver)) if actual_log_driver != expected_log_driver:
differing.append(container) self.reload_reasons.append('log_driver ({0} => {1})'.format(actual_log_driver, expected_log_driver))
continue differing.append(container)
continue
return differing return differing

Loading…
Cancel
Save