Skip to content

Commit

Permalink
[ContainerRegistry] Add cloud configuration support
Browse files Browse the repository at this point in the history
- Update test resource deployment
  • Loading branch information
jeremymeng committed Jul 8, 2021
1 parent f4ba895 commit fe7a06d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sdk/containerregistry/container-registry/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ stages:
ServiceDirectory: containerregistry
MatrixFilters:
- DependencyVersion=^$
- Pool=.*mms-ubuntu-2004.*
SupportedClouds: 'Public,UsGov,China'
EnvVars:
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
Expand Down
8 changes: 8 additions & 0 deletions sdk/containerregistry/test-resources-post.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ param (
[string] $TestApplicationSecret
)

Get-AzEnvironment | Write-Host

if ( $DeploymentOutputs['CONTAINER_REGISTRY_ENDPOINT'].EndsWith('.azurecr.us') ) {
Connect-AzAccount –Environment AzureUSGovernment
} elseif ( $DeploymentOutputs['CONTAINER_REGISTRY_ENDPOINT'].EndsWith('.azurecr.cn') ) {
Connect-AzAccount –Environment AzureChinaCloud
}

Import-AzContainerRegistryImage `
-ResourceGroupName $DeploymentOutputs['CONTAINERREGISTRY_RESOURCE_GROUP'] `
-RegistryName $DeploymentOutputs['CONTAINER_REGISTRY_NAME'] `
Expand Down
8 changes: 6 additions & 2 deletions sdk/containerregistry/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
"metadata": {
"description": "The location of the resource. By default, this is the same as the resource group."
}
},
"containerRegistryEndpointSuffix": {
"defaultValue": ".azurecr.io",
"type": "string"
}
},
"variables": {
"apiVersion": "2020-11-01-preview",
"endpointValue": "[format('https://{0}.azurecr.io', parameters('baseName'))]",
"endpointValue": "[format('https://{0}{1}', parameters('baseName'), parameters('containerRegistryEndpointSuffix'))]",
"anonRegistryName": "[format('{0}anon', parameters('baseName'))]",
"anonEndpointValue": "[format('https://{0}.azurecr.io', variables('anonRegistryName'))]"
"anonEndpointValue": "[format('https://{0}{1}', variables('anonRegistryName'), parameters('containerRegistryEndpointSuffix'))]"
},
"resources": [
{
Expand Down

0 comments on commit fe7a06d

Please sign in to comment.