Fix case when "network_config" is not passed

Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
This commit is contained in:
Mariano Scazzariello 2023-05-07 12:15:32 +02:00
parent a18f91bf08
commit 7870503c52
No known key found for this signature in database
GPG Key ID: 95C376C0221294BF
1 changed files with 3 additions and 3 deletions

View File

@ -1148,14 +1148,14 @@ def _create_container_args(kwargs):
network = kwargs.pop('network', None) network = kwargs.pop('network', None)
network_config = kwargs.pop('network_config', None) network_config = kwargs.pop('network_config', None)
if network: if network:
network_configuration = EndpointConfig( endpoint_config = EndpointConfig(
host_config_kwargs['version'], host_config_kwargs['version'],
**network_config **network_config
) if network_config else None ) if network_config else None
create_kwargs['networking_config'] = NetworkingConfig( create_kwargs['networking_config'] = NetworkingConfig(
{network: network_configuration} {network: endpoint_config}
) ) if endpoint_config else {network: None}
host_config_kwargs['network_mode'] = network host_config_kwargs['network_mode'] = network
# All kwargs should have been consumed by this point, so raise # All kwargs should have been consumed by this point, so raise