From d7b8d50acd96cf49c26c52af0e4c1fdb6a54ed24 Mon Sep 17 00:00:00 2001 From: Arsenii Petrovich Date: Tue, 23 Jun 2020 12:58:53 +0300 Subject: [PATCH 1/4] Fix data disks URI Fixing bug appeared in 0589f57d4d85ef28054d47049c346e53c1698205 --- builder/azure/common/template/template_builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/azure/common/template/template_builder.go b/builder/azure/common/template/template_builder.go index 9c2e02d32..f7447d8e0 100644 --- a/builder/azure/common/template/template_builder.go +++ b/builder/azure/common/template/template_builder.go @@ -275,7 +275,7 @@ func (s *TemplateBuilder) SetAdditionalDisks(diskSizeGB []int32, dataDiskname st dataDisks[i].ManagedDisk = profile.OsDisk.ManagedDisk } else { dataDisks[i].Vhd = &compute.VirtualHardDisk{ - URI: to.StringPtr(fmt.Sprintf("[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-%d','.vhd')]", i+1)), + URI: to.StringPtr(fmt.Sprintf("[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'),'-%d','.vhd')]", i+1)), } dataDisks[i].ManagedDisk = nil } From c2f352ee6e4341b903f845e612e88867cb5f79fc Mon Sep 17 00:00:00 2001 From: Arsenii Petrovich Date: Wed, 24 Jun 2020 01:35:35 +0300 Subject: [PATCH 2/4] Update JSONs to fix tests and make them work with the latest URL changes --- ...actory_test.TestVirtualMachineDeployment11.approved.json | 4 ++-- .../template_builder_test.TestBuildWindows02.approved.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json b/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json index 15b0ced92..7931e37c0 100644 --- a/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json +++ b/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json @@ -149,7 +149,7 @@ "lun": 0, "name": "[concat(parameters('dataDiskName'),'-1')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-1','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'), variables('vmStorageAccountContainerName'), '/', parameters('dataDiskName'), '-1','.vhd')]" } } ], @@ -191,4 +191,4 @@ "vmStorageAccountContainerName": "images", "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" } -} \ No newline at end of file +} diff --git a/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json b/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json index 06f554cda..a6c2fd7e8 100644 --- a/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json +++ b/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json @@ -163,7 +163,7 @@ "lun": 0, "name": "[concat(parameters('dataDiskName'),'-1')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-1','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'), variables('vmStorageAccountContainerName'), '/', parameters('dataDiskName'), '-1','.vhd')]" } }, { @@ -173,7 +173,7 @@ "lun": 1, "name": "[concat(parameters('dataDiskName'),'-2')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-2','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'), variables('vmStorageAccountContainerName'), '/', parameters('dataDiskName'), '-2','.vhd')]" } } ], @@ -209,4 +209,4 @@ "vmStorageAccountContainerName": "images", "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" } -} \ No newline at end of file +} From f3c33f9a279760eab251ea0269173bc9f56bd4bd Mon Sep 17 00:00:00 2001 From: Arsenii Petrovich Date: Wed, 24 Jun 2020 16:08:48 +0300 Subject: [PATCH 3/4] remove spaces --- ..._factory_test.TestVirtualMachineDeployment11.approved.json | 2 +- .../template_builder_test.TestBuildWindows02.approved.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json b/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json index 7931e37c0..e38ee7849 100644 --- a/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json +++ b/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json @@ -149,7 +149,7 @@ "lun": 0, "name": "[concat(parameters('dataDiskName'),'-1')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'), variables('vmStorageAccountContainerName'), '/', parameters('dataDiskName'), '-1','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'), '-1','.vhd')]" } } ], diff --git a/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json b/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json index a6c2fd7e8..093c323f1 100644 --- a/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json +++ b/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json @@ -163,7 +163,7 @@ "lun": 0, "name": "[concat(parameters('dataDiskName'),'-1')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'), variables('vmStorageAccountContainerName'), '/', parameters('dataDiskName'), '-1','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'), '-1','.vhd')]" } }, { @@ -173,7 +173,7 @@ "lun": 1, "name": "[concat(parameters('dataDiskName'),'-2')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'), variables('vmStorageAccountContainerName'), '/', parameters('dataDiskName'), '-2','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'), '-2','.vhd')]" } } ], From 8d209caf348a98aa94509e729affd838104090e5 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 24 Jun 2020 09:20:32 -0400 Subject: [PATCH 4/4] Fix spacing and line endings --- ...actory_test.TestVirtualMachineDeployment11.approved.json | 4 ++-- .../template_builder_test.TestBuildWindows02.approved.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json b/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json index e38ee7849..96af5d2e2 100644 --- a/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json +++ b/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment11.approved.json @@ -149,7 +149,7 @@ "lun": 0, "name": "[concat(parameters('dataDiskName'),'-1')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'), '-1','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'),'-1','.vhd')]" } } ], @@ -191,4 +191,4 @@ "vmStorageAccountContainerName": "images", "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" } -} +} \ No newline at end of file diff --git a/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json b/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json index 093c323f1..281b8db83 100644 --- a/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json +++ b/builder/azure/common/template/template_builder_test.TestBuildWindows02.approved.json @@ -163,7 +163,7 @@ "lun": 0, "name": "[concat(parameters('dataDiskName'),'-1')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'), '-1','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'),'-1','.vhd')]" } }, { @@ -173,7 +173,7 @@ "lun": 1, "name": "[concat(parameters('dataDiskName'),'-2')]", "vhd": { - "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'), '-2','.vhd')]" + "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/',parameters('dataDiskName'),'-2','.vhd')]" } } ], @@ -209,4 +209,4 @@ "vmStorageAccountContainerName": "images", "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" } -} +} \ No newline at end of file