@@ -71,7 +71,7 @@ def delete_container(client, resource_group_name, name, **kwargs):
7171 return client .begin_delete (resource_group_name , name )
7272
7373
74- # pylint: disable=too-many-statements
74+ # pylint: disable=too-many-statements,too-many-branches
7575def create_container (cmd ,
7676 resource_group_name ,
7777 name = None ,
@@ -142,8 +142,13 @@ def create_container(cmd,
142142
143143 standby_pool_profile_reference = _create_standby_pool_profile_reference (standby_pool_profile_id = standby_pool_profile_id , fail_container_group_create_on_reuse_failure = fail_container_group_create_on_reuse_failure )
144144
145- ports = ports or [80 ]
146- protocol = protocol or ContainerGroupNetworkProtocol .tcp
145+ # No default values need to be set for the standbypool reuse scenario
146+ if standby_pool_profile_id is not None :
147+ vnet_address_prefix = None
148+ subnet_address_prefix = None
149+ else :
150+ ports = ports or [80 ]
151+ protocol = protocol or ContainerGroupNetworkProtocol .tcp
147152
148153 config_map = _create_config_map (config_map )
149154
@@ -221,7 +226,9 @@ def create_container(cmd,
221226 subnet_id = _get_subnet_id (cmd , location , resource_group_name , vnet , vnet_address_prefix , subnet , subnet_address_prefix )
222227 cgroup_subnet = [ContainerGroupSubnetId (id = subnet_id )]
223228
224- cgroup_ip_address = _create_ip_address (ip_address , ports , protocol , dns_name_label , subnet_id )
229+ cgroup_ip_address = None
230+ if standby_pool_profile_id is None :
231+ cgroup_ip_address = _create_ip_address (ip_address , ports , protocol , dns_name_label , subnet_id )
225232
226233 # Setup zones, validation done in control plane so check is not needed here
227234 zones = None
0 commit comments