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
2 changes: 2 additions & 0 deletions src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Release History

**ACR**

* `az acr create`: Add `--writable-cache-repos` parameter to enable or disable cache operations that write to repositories in the registry
* `az acr update`: Add `--writable-cache-repos` parameter to enable or disable cache operations that write to repositories in the registry
* `az acr create`: Add `--data-endpoint-enabled` parameter to support enabling dedicated data endpoint for client firewall configuration (#33472)
* `az acr create`: Add `--endpoint-protocol` parameter to support specifying the endpoint protocol for the registry (#33472)
* `az acr task logs`: Align log streaming with the default TLS behavior used by the rest of Azure CLI commands (#33486)
Expand Down
6 changes: 6 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@
- name: Create a managed container registry with the Premium SKU and dual-stack (IPv4 and IPv6) endpoint protocol.
text: >
az acr create -n myregistry -g MyResourceGroup --sku Premium --data-endpoint-enabled true --endpoint-protocol IPv4AndIPv6
- name: Create a managed container registry with writable cache repositories enabled.
text: >
az acr create -n myregistry -g MyResourceGroup --sku Premium --writable-cache-repos enabled
"""

helps['acr credential'] = """
Expand Down Expand Up @@ -1535,6 +1538,9 @@
- name: Update the endpoint protocol for an Azure Container Registry.
text: >
az acr update -n myregistry --endpoint-protocol IPv4AndIPv6
- name: Enable writable cache repositories on an existing registry.
text: >
az acr update -n myregistry --writable-cache-repos enabled
"""

helps['acr webhook'] = """
Expand Down
8 changes: 6 additions & 2 deletions src/azure-cli/azure/cli/command_modules/acr/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@

def load_arguments(self, _): # pylint: disable=too-many-statements
PasswordName, DefaultAction, PolicyStatus, WebhookAction, WebhookStatus, \
TokenStatus, ZoneRedundancy, AutoGeneratedDomainNameLabelScope, RegionalEndpoints = self.get_models(
TokenStatus, ZoneRedundancy, AutoGeneratedDomainNameLabelScope, RegionalEndpoints, \
WritableCacheRepos = self.get_models(
'PasswordName', 'DefaultAction', 'PolicyStatus', 'WebhookAction', 'WebhookStatus',
'TokenStatus', 'ZoneRedundancy', 'AutoGeneratedDomainNameLabelScope', 'RegionalEndpoints')
'TokenStatus', 'ZoneRedundancy', 'AutoGeneratedDomainNameLabelScope', 'RegionalEndpoints',
'WritableCacheRepos')
from azure.mgmt.containerregistrytasks.models import (
TaskStatus, BaseImageTriggerType, SourceRegistryLoginMode, UpdateTriggerPayloadType, RunStatus)

Expand Down Expand Up @@ -128,6 +130,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements

with self.argument_context('acr create') as c:
c.argument('allow_metadata_search', arg_type=get_three_state_flag(), is_preview=True, help="Enable or disable the metadata-search feature for the registry. If not specified, this is set to disabled by default.")
c.argument('writable_cache_repos', arg_type=get_enum_type(WritableCacheRepos), is_preview=True, help="Enable or disable cache operations that write to repositories in this registry. If not specified, this is set to Disabled by default.")

with self.argument_context('acr create') as c:
c.argument('dnl_scope', options_list=['--dnl-scope'], help='Domain name label scope will add a hash to the resource name. The resulting login server name will be in the format `registryname`-`hash`.azurecr-io. Default is Unsecure.', is_preview=True, arg_type=get_enum_type(AutoGeneratedDomainNameLabelScope))
Expand All @@ -142,6 +145,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements

with self.argument_context('acr update') as c:
c.argument('allow_metadata_search', arg_type=get_three_state_flag(), is_preview=True, help="Enable or disable the metadata-search feature for the registry.")
c.argument('writable_cache_repos', arg_type=get_enum_type(WritableCacheRepos), is_preview=True, help="Enable or disable cache operations that write to repositories in this registry.")

with self.argument_context('acr import') as c:
c.argument('source_image', options_list=['--source'], help="Source image name or fully qualified source containing the registry login server. If `--registry` is used, `--source` will always be interpreted as a source image, even if it contains the login server.")
Expand Down
12 changes: 10 additions & 2 deletions src/azure-cli/azure/cli/command_modules/acr/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def acr_create(cmd,
role_assignment_mode=None,
regional_endpoints=None,
data_endpoint_enabled=None,
endpoint_protocol=None):
endpoint_protocol=None,
writable_cache_repos=None):
if default_action and sku not in get_premium_sku(cmd):
raise CLIError(NETWORK_RULE_NOT_SUPPORTED)

Expand Down Expand Up @@ -122,6 +123,9 @@ def acr_create(cmd,
if endpoint_protocol is not None:
registry.endpoint_protocol = endpoint_protocol

if writable_cache_repos is not None:
registry.writable_cache_repos = writable_cache_repos

_handle_network_bypass(cmd, registry, allow_trusted_services)
_handle_export_policy(cmd, registry, allow_exports)

Expand Down Expand Up @@ -169,7 +173,8 @@ def acr_update_custom(cmd,
allow_metadata_search=None,
role_assignment_mode=None,
regional_endpoints=None,
endpoint_protocol=None):
endpoint_protocol=None,
writable_cache_repos=None):
if sku is not None:
Sku = cmd.get_models('Sku')
instance.sku = Sku(name=sku)
Expand Down Expand Up @@ -204,6 +209,9 @@ def acr_update_custom(cmd,
if endpoint_protocol is not None:
instance.endpoint_protocol = endpoint_protocol

if writable_cache_repos is not None:
instance.writable_cache_repos = writable_cache_repos

_handle_network_bypass(cmd, instance, allow_trusted_services)
_handle_export_policy(cmd, instance, allow_exports)

Expand Down
Loading
Loading