Skip to content

Commit

Permalink
Fix for Azure#3741
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSidebotham committed Nov 6, 2024
1 parent 6c9b47e commit 1412622
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 28 deletions.
15 changes: 10 additions & 5 deletions avm/res/container-registry/registry/cache-rule/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ resource registry 'Microsoft.ContainerRegistry/registries@2023-06-01-preview' ex
resource cacheRule 'Microsoft.ContainerRegistry/registries/cacheRules@2023-06-01-preview' = {
name: name
parent: registry
properties: {
sourceRepository: sourceRepository
targetRepository: targetRepository
credentialSetResourceId: credentialSetResourceId
}
properties: !empty(credentialSetResourceId)
? {
sourceRepository: sourceRepository
targetRepository: targetRepository
credentialSetResourceId: credentialSetResourceId
}
: {
sourceRepository: sourceRepository
targetRepository: targetRepository
}
}

@description('The Name of the Cache Rule.')
Expand Down
10 changes: 3 additions & 7 deletions avm/res/container-registry/registry/cache-rule/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.3.12046",
"templateHash": "17205938486061573561"
"version": "0.30.23.60470",
"templateHash": "6676256769294761512"
},
"name": "Container Registries Cache",
"description": "Cache for Azure Container Registry (Preview) feature allows users to cache container images in a private container registry. Cache for ACR, is a preview feature available in Basic, Standard, and Premium service tiers ([ref](https://learn.microsoft.com/en-us/azure/container-registry/tutorial-registry-cache)).",
Expand Down Expand Up @@ -50,11 +50,7 @@
"type": "Microsoft.ContainerRegistry/registries/cacheRules",
"apiVersion": "2023-06-01-preview",
"name": "[format('{0}/{1}', parameters('registryName'), parameters('name'))]",
"properties": {
"sourceRepository": "[parameters('sourceRepository')]",
"targetRepository": "[parameters('targetRepository')]",
"credentialSetResourceId": "[parameters('credentialSetResourceId')]"
}
"properties": "[if(not(empty(parameters('credentialSetResourceId'))), createObject('sourceRepository', parameters('sourceRepository'), 'targetRepository', parameters('targetRepository'), 'credentialSetResourceId', parameters('credentialSetResourceId')), createObject('sourceRepository', parameters('sourceRepository'), 'targetRepository', parameters('targetRepository')))]"
}
],
"outputs": {
Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/credential-set/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.3.12046",
"templateHash": "13281764602355848660"
"version": "0.30.23.60470",
"templateHash": "7759513970094711275"
},
"name": "Container Registries Credential Sets",
"description": "This module deploys an ACR Credential Set.",
Expand Down
10 changes: 3 additions & 7 deletions avm/res/container-registry/registry/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "2277340268999354626"
"templateHash": "14076061883339486537"
},
"name": "Azure Container Registries (ACR)",
"description": "This module deploys an Azure Container Registry (ACR).",
Expand Down Expand Up @@ -1479,7 +1479,7 @@
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "1396902957012921251"
"templateHash": "6676256769294761512"
},
"name": "Container Registries Cache",
"description": "Cache for Azure Container Registry (Preview) feature allows users to cache container images in a private container registry. Cache for ACR, is a preview feature available in Basic, Standard, and Premium service tiers ([ref](https://learn.microsoft.com/en-us/azure/container-registry/tutorial-registry-cache)).",
Expand Down Expand Up @@ -1524,11 +1524,7 @@
"type": "Microsoft.ContainerRegistry/registries/cacheRules",
"apiVersion": "2023-06-01-preview",
"name": "[format('{0}/{1}', parameters('registryName'), parameters('name'))]",
"properties": {
"sourceRepository": "[parameters('sourceRepository')]",
"targetRepository": "[parameters('targetRepository')]",
"credentialSetResourceId": "[parameters('credentialSetResourceId')]"
}
"properties": "[if(not(empty(parameters('credentialSetResourceId'))), createObject('sourceRepository', parameters('sourceRepository'), 'targetRepository', parameters('targetRepository'), 'credentialSetResourceId', parameters('credentialSetResourceId')), createObject('sourceRepository', parameters('sourceRepository'), 'targetRepository', parameters('targetRepository')))]"
}
],
"outputs": {
Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/replication/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.3.12046",
"templateHash": "11507205381257602922"
"version": "0.30.23.60470",
"templateHash": "4997004041066797666"
},
"name": "Azure Container Registry (ACR) Replications",
"description": "This module deploys an Azure Container Registry (ACR) Replication.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/scope-map/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.3.12046",
"templateHash": "17045733538280748766"
"version": "0.30.23.60470",
"templateHash": "17963190751439748514"
},
"name": "Container Registries scopeMaps",
"description": "This module deploys an Azure Container Registry (ACR) scopeMap.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ module testDeployment '../../../main.bicep' = [
]
cacheRules: [
{
name: 'customRule'
name: 'customRuleWithAuth'
sourceRepository: 'docker.io/library/hello-world'
targetRepository: 'cached-docker-hub/hello-world'
credentialSetResourceId: nestedDependencies.outputs.acrCredentialSetResourceId
}
{
name: 'customRuleWithoutAuth'
sourceRepository: 'mcr.microsoft.com/bicep/avm/*'
targetRepository: 'avm/*'
}
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/webhook/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.3.12046",
"templateHash": "3542060088842117365"
"version": "0.30.23.60470",
"templateHash": "10216591470402784498"
},
"name": "Azure Container Registry (ACR) Webhooks",
"description": "This module deploys an Azure Container Registry (ACR) Webhook.",
Expand Down

0 comments on commit 1412622

Please sign in to comment.