diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py index 916e387dbf..599ed14b4b 100755 --- a/docker/docker-puppet.py +++ b/docker/docker-puppet.py @@ -131,6 +131,8 @@ process_count = int(os.environ.get('PROCESS_COUNT', log = get_logger() log.info('Running docker-puppet') config_file = os.environ.get('CONFIG', '/var/lib/docker-puppet/docker-puppet.json') +# If specified, only this config_volume will be used +config_volume_only = os.environ.get('CONFIG_VOLUME', None) log.debug('CONFIG: %s' % config_file) with open(config_file) as f: json_data = json.load(f) @@ -187,8 +189,12 @@ for service in (json_data or []): log.warn("Config containers do not match even though" " shared volumes are the same!") else: - log.debug("Adding new service") - configs[config_volume] = service + if not config_volume_only or (config_volume_only == config_volume): + log.debug("Adding new service") + configs[config_volume] = service + else: + log.debug("Ignoring %s due to $CONFIG_VOLUME=%s" % + (config_volume, config_volume_only)) log.info('Service compilation completed.') diff --git a/releasenotes/notes/docker-puppet-config-volume-5ad50b90dc24672b.yaml b/releasenotes/notes/docker-puppet-config-volume-5ad50b90dc24672b.yaml new file mode 100644 index 0000000000..58038326cc --- /dev/null +++ b/releasenotes/notes/docker-puppet-config-volume-5ad50b90dc24672b.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - If docker-puppet.py fails on any config_volume, it can be difficult to + reproduce the failure given all the other entries in docker-puppet.json. + Often to reproduce a single failure, one has to modify the json file, and + remove all other entries, save the result to a new file, then pass that new + file as $CONFIG. The ability to specify $CONFIG_VOLUME, which will cause + docker-puppet.py to only run the configuration for the specified entry in + docker-puppet.json whose config_volume value matches the user specified + value has been added.