Skip to content

Commit

Permalink
Merge pull request #3687 from Azure/kimorris27/hotfix-compute-api-ver…
Browse files Browse the repository at this point in the history
…sion

Hotfix: compute API version used in ARM templates
  • Loading branch information
mociarain authored Jul 17, 2024
2 parents 81f22cb + 7fabe15 commit d2d06a8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/deploy/assets/cluster-development-predeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"type": "Microsoft.Compute/diskEncryptionSets",
"location": "[resourceGroup().location]",
"condition": "[parameters('ci')]",
"apiVersion": "2021-12-01",
"apiVersion": "2021-04-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults/keys', parameters('kvName'), concat(resourceGroup().name, '-disk-encryption-key'))]"
]
Expand Down
4 changes: 2 additions & 2 deletions pkg/deploy/assets/env-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"name": "[concat(resourceGroup().name, '-disk-encryption-set')]",
"type": "Microsoft.Compute/diskEncryptionSets",
"location": "[resourceGroup().location]",
"apiVersion": "2021-12-01",
"apiVersion": "2021-04-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults/keys', concat(take(resourceGroup().name,10), '-dev-sharedKV'), concat(resourceGroup().name, '-disk-encryption-key'))]"
]
Expand Down Expand Up @@ -420,7 +420,7 @@
"tags": {
"azsecpack": "nonprod"
},
"apiVersion": "2021-12-01",
"apiVersion": "2024-03-01",
"dependsOn": [
"[resourceId('Microsoft.Network/loadBalancers', 'dev-lb-internal')]"
]
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/assets/gateway-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
"type": "Microsoft.Compute/virtualMachineScaleSets",
"location": "[resourceGroup().location]",
"tags": {},
"apiVersion": "2021-12-01",
"apiVersion": "2024-03-01",
"dependsOn": [
"[resourceId('Microsoft.Network/loadBalancers', 'gateway-lb-internal')]"
]
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/assets/rp-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"type": "Microsoft.Compute/virtualMachineScaleSets",
"location": "[resourceGroup().location]",
"tags": {},
"apiVersion": "2021-12-01",
"apiVersion": "2024-03-01",
"dependsOn": [
"[resourceId('Microsoft.Authorization/roleAssignments', guid(resourceGroup().id, parameters('rpServicePrincipalId'), 'RP / Reader'))]",
"[resourceId('Microsoft.Network/loadBalancers', 'rp-lb')]"
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/generator/resources_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (g *generator) diskEncryptionSet() *arm.Resource {

return &arm.Resource{
Resource: diskEncryptionSet,
APIVersion: azureclient.APIVersion("Microsoft.Compute"),
APIVersion: azureclient.APIVersion("Microsoft.Compute/diskEncryptionSets"),
Condition: to.StringPtr("[parameters('ci')]"),
DependsOn: []string{fmt.Sprintf("[resourceId('Microsoft.KeyVault/vaults/keys', parameters('kvName'), %s)]", diskEncryptionKeyName)},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/generator/resources_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func (g *generator) devDiskEncryptionSet() *arm.Resource {

return &arm.Resource{
Resource: diskEncryptionSet,
APIVersion: azureclient.APIVersion("Microsoft.Compute"),
APIVersion: azureclient.APIVersion("Microsoft.Compute/diskEncryptionSets"),
DependsOn: []string{
fmt.Sprintf("[resourceId('Microsoft.KeyVault/vaults/keys', %s, %s)]", sharedKeyVaultName, sharedDiskEncryptionKeyName),
},
Expand Down
7 changes: 5 additions & 2 deletions pkg/util/azureclient/apiversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import (
"strings"
)

// keys must be lower case
// This map stores the versions of different Azure APIs to be used in generated ARM templates in various
// parts of the codebase. The versions used here do not necessarily align with the API versions used in the
// Go client wrappers defined in pkg/util/azureclient/mgmt and pkg/util/azureclient/azuresdk.
// Keys must be lower case.
var apiVersions = map[string]string{
"microsoft.authorization": "2018-09-01-preview",
"microsoft.authorization/denyassignments": "2018-07-01-preview",
"microsoft.authorization/roledefinitions": "2018-01-01-preview",
"microsoft.compute": "2021-12-01",
"microsoft.compute": "2024-03-01",
"microsoft.compute/diskencryptionsets": "2021-04-01",
"microsoft.compute/disks": "2019-03-01",
"microsoft.compute/galleries": "2022-03-03",
Expand Down

0 comments on commit d2d06a8

Please sign in to comment.