mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Apply driver_opts processing to network configs
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
fcf78fe3de
commit
1e29ad9fc7
@ -292,8 +292,12 @@ def load(config_details):
|
||||
config_details = config_details._replace(config_files=processed_files)
|
||||
|
||||
main_file = config_details.config_files[0]
|
||||
volumes = load_volumes(config_details.config_files)
|
||||
networks = load_mapping(config_details.config_files, 'get_networks', 'Network')
|
||||
volumes = load_mapping(
|
||||
config_details.config_files, 'get_volumes', 'Volume'
|
||||
)
|
||||
networks = load_mapping(
|
||||
config_details.config_files, 'get_networks', 'Network'
|
||||
)
|
||||
service_dicts = load_services(
|
||||
config_details.working_dir,
|
||||
main_file,
|
||||
@ -333,17 +337,14 @@ def load_mapping(config_files, get_func, entity_type):
|
||||
|
||||
mapping[name] = config
|
||||
|
||||
if 'driver_opts' in config:
|
||||
config['driver_opts'] = build_string_dict(
|
||||
config['driver_opts']
|
||||
)
|
||||
|
||||
return mapping
|
||||
|
||||
|
||||
def load_volumes(config_files):
|
||||
volumes = load_mapping(config_files, 'get_volumes', 'Volume')
|
||||
for volume_name, volume in volumes.items():
|
||||
if 'driver_opts' in volume:
|
||||
volume['driver_opts'] = build_string_dict(volume['driver_opts'])
|
||||
return volumes
|
||||
|
||||
|
||||
def load_services(working_dir, config_file, service_configs):
|
||||
def build_service(service_name, service_dict, service_names):
|
||||
service_config = ServiceConfig.with_abs_paths(
|
||||
|
@ -95,4 +95,4 @@ def microseconds_from_time_nano(time_nano):
|
||||
|
||||
|
||||
def build_string_dict(source_dict):
|
||||
return dict([(k, str(v)) for k, v in source_dict.items()])
|
||||
return dict((k, str(v)) for k, v in source_dict.items())
|
||||
|
Loading…
x
Reference in New Issue
Block a user