Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
with self.argument_context('acr update', arg_group='Network Rule') as c:
c.argument('data_endpoint_enabled', get_three_state_flag(), help="Enable dedicated data endpoint for client firewall configuration")

with self.argument_context('acr update') as c:
c.argument('anonymous_pull_enabled', get_three_state_flag(), help="Enable registry-wide pull from unauthenticated clients")

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.")
c.argument('source_registry', options_list=['--registry', '-r'], help='The source Azure container registry. This can be name, login server or resource ID of the source registry.')
Expand Down
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def acr_update_custom(cmd,
data_endpoint_enabled=None,
public_network_enabled=None,
allow_trusted_services=None,
anonymous_pull_enabled=None,
tags=None):
if sku is not None:
Sku = cmd.get_models('Sku')
Expand All @@ -128,6 +129,9 @@ def acr_update_custom(cmd,
if public_network_enabled is not None:
_configure_public_network_access(cmd, instance, public_network_enabled)

if anonymous_pull_enabled is not None:
instance.anonymous_pull_enabled = anonymous_pull_enabled

_handle_network_bypass(cmd, instance, allow_trusted_services)

return instance
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,18 @@ def test_acr_with_public_network_access(self, resource_group, resource_group_loc
checks=[self.check('publicNetworkAccess', 'Disabled'),
self.check('networkRuleBypassOptions', 'None')])

@ResourceGroupPreparer()
def test_acr_with_anonymous_pull(self, resource_group, resource_group_location):
self.kwargs.update({
'registry_name': self.create_random_name('testreg', 20)
})
self.cmd('acr create --name {registry_name} --resource-group {rg} --sku premium -l eastus',
checks=[self.check('anonymousPullEnabled', False)])
self.cmd('acr update --name {registry_name} --resource-group {rg} --anonymous-pull-enabled true',
checks=[self.check('anonymousPullEnabled', True)])
self.cmd('acr update --name {registry_name} --resource-group {rg} --anonymous-pull-enabled false',
checks=[self.check('anonymousPullEnabled', False)])

@ResourceGroupPreparer(location='centraluseuap')
def test_acr_with_private_endpoint(self, resource_group):
self.kwargs.update({
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ azure-mgmt-cognitiveservices==6.3.0
azure-mgmt-compute==19.0.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==3.0.0rc16
azure-mgmt-containerregistry==3.0.0rc17

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since SDK version changed, I'll suppose you've already run live tests :)

@yugangw-msft yugangw-msft Mar 9, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yungezz there is no api version bump in this SDK version. The spec change PR is here FYI: Azure/azure-rest-api-specs#13001
But I still ran a few more tests live to provide enough confidence for this PR. Please take a look and let me know if you have any other suggestions.

azure-mgmt-containerservice==9.4.0
azure-mgmt-core==1.2.1
azure-core==1.10.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ azure-mgmt-cognitiveservices==6.3.0
azure-mgmt-compute==19.0.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==3.0.0rc16
azure-mgmt-containerregistry==3.0.0rc17
azure-mgmt-containerservice==9.4.0
azure-mgmt-core==1.2.1
azure-core==1.10.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ azure-mgmt-cognitiveservices==6.3.0
azure-mgmt-compute==19.0.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==3.0.0rc16
azure-mgmt-containerregistry==3.0.0rc17
azure-mgmt-containerservice==9.4.0
azure-mgmt-core==1.2.1
azure-core==1.10.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
'azure-mgmt-compute~=19.0.0',
'azure-mgmt-consumption~=2.0',
'azure-mgmt-containerinstance~=1.4',
'azure-mgmt-containerregistry==3.0.0rc16',
'azure-mgmt-containerregistry==3.0.0rc17',
'azure-mgmt-cosmosdb~=3.0.0',
'azure-mgmt-containerservice~=9.4.0',
'azure-mgmt-databoxedge~=0.2.0',
Expand Down