Skip to content
Open
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
6 changes: 0 additions & 6 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,11 @@ acr replication create:
global_endpoint_routing:
rule_exclusions:
- option_length_too_long
region_endpoint_enabled:
rule_exclusions:
- option_length_too_long
acr replication update:
parameters:
global_endpoint_routing:
rule_exclusions:
- option_length_too_long
region_endpoint_enabled:
rule_exclusions:
- option_length_too_long
acr run:
parameters:
source_location:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# --------------------------------------------------------------------------------------------

from azure.cli.core.breaking_change import (
register_argument_deprecate,
register_command_group_deprecate,
register_logic_breaking_change
)
Expand Down Expand Up @@ -42,8 +41,3 @@
detail='The `--status enabled` parameter will no longer be accepted and will result in '
'an error due to Docker Content Trust deprecation.',
doc_link='https://aka.ms/acr/dctdeprecation')

register_argument_deprecate('acr replication create', '--region-endpoint-enabled',
redirect='--global-endpoint-routing')
register_argument_deprecate('acr replication update', '--region-endpoint-enabled',
redirect='--global-endpoint-routing')
1 change: 0 additions & 1 deletion src/azure-cli/azure/cli/command_modules/acr/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
help_str += ' Default: true.' if 'create' in scope else '' # suffix help with default if command is for create

with self.argument_context(scope) as c:
c.argument('region_endpoint_enabled', arg_type=get_three_state_flag(), help=help_str)
c.argument('global_endpoint_routing', arg_type=get_three_state_flag(), help=help_str)

with self.argument_context('acr run') as c:
Expand Down
16 changes: 4 additions & 12 deletions src/azure-cli/azure/cli/command_modules/acr/replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ def acr_replication_create(cmd,
registry_name,
resource_group_name=None,
replication_name=None,
region_endpoint_enabled=None,
global_endpoint_routing=None,
zone_redundancy=None,
tags=None):
registry, resource_group_name = validate_premium_registry(
cmd, registry_name, resource_group_name, REPLICATIONS_NOT_SUPPORTED)

# --global-endpoint-routing takes precedence over deprecated --region-endpoint-enabled
if global_endpoint_routing is not None:
region_endpoint_enabled = global_endpoint_routing

normalized_location = "".join(location.split()).lower()
if registry.location == normalized_location:
raise CLIError('Replication could not be created in the same location as the registry.')
Expand All @@ -50,7 +45,7 @@ def acr_replication_create(cmd,
replication_name = replication_name or normalized_location
replication_properties = ReplicationType(
location=location,
region_endpoint_enabled=region_endpoint_enabled,
region_endpoint_enabled=global_endpoint_routing,
zone_redundancy=zone_redundancy,
tags=tags)

Expand Down Expand Up @@ -85,15 +80,12 @@ def acr_replication_show(cmd,
return client.get(resource_group_name, registry_name, replication_name)


def acr_replication_update_custom(instance, region_endpoint_enabled=None, global_endpoint_routing=None, tags=None):
def acr_replication_update_custom(instance, global_endpoint_routing=None, tags=None):
if tags is not None:
instance.tags = tags

# --global-endpoint-routing takes precedence over deprecated --region-endpoint-enabled
effective_value = global_endpoint_routing if global_endpoint_routing is not None \
else region_endpoint_enabled
if effective_value is not None:
instance.region_endpoint_enabled = effective_value
if global_endpoint_routing is not None:
instance.region_endpoint_enabled = global_endpoint_routing

return instance

Expand Down
Loading
Loading