Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/azure-cli/azure/cli/command_modules/container/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def delete_container(client, resource_group_name, name, **kwargs):
return client.begin_delete(resource_group_name, name)


# pylint: disable=too-many-statements
# pylint: disable=too-many-statements,too-many-branches
def create_container(cmd,
resource_group_name,
name=None,
Expand Down Expand Up @@ -142,8 +142,13 @@ def create_container(cmd,

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)

ports = ports or [80]
protocol = protocol or ContainerGroupNetworkProtocol.tcp
# No default values need to be set for the standbypool reuse scenario
if standby_pool_profile_id is not None:
vnet_address_prefix = None
subnet_address_prefix = None
else:
ports = ports or [80]
protocol = protocol or ContainerGroupNetworkProtocol.tcp

config_map = _create_config_map(config_map)

Expand Down Expand Up @@ -221,7 +226,9 @@ def create_container(cmd,
subnet_id = _get_subnet_id(cmd, location, resource_group_name, vnet, vnet_address_prefix, subnet, subnet_address_prefix)
cgroup_subnet = [ContainerGroupSubnetId(id=subnet_id)]

cgroup_ip_address = _create_ip_address(ip_address, ports, protocol, dns_name_label, subnet_id)
cgroup_ip_address = None
if standby_pool_profile_id is None:
cgroup_ip_address = _create_ip_address(ip_address, ports, protocol, dns_name_label, subnet_id)

# Setup zones, validation done in control plane so check is not needed here
zones = None
Expand Down
Loading
Loading