packer-cn/builder/azure
Wilken Rivera afd33679f5 builder/azure_arm: Fix build failures due to the deletion of attached managed disks
Previously (prior to v1.6.2) the Azure ARM builder had two delete functions
one that would run before any of the StepDelete* types, and one on deployment template
cleanup. The refactored coded re-introduces the logic from the previously removed
step in v1.6.1 as the main delete logic for the whole deployment
template. Ensuring that all deployed items are deleted before trying to
remove any managed disks.

This change moves all the deletion logic into the
step_deployment_template#Cleanup function to ensure that dependent steps
are only called once the created deployment items (i.e
StepDelateAdditionalDisks) have been deleted.

Test results before change
```

    compute.DisksClient#Delete: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="OperationNotAllowed" Message="Disk pkrdd02e9rzzu5k-1 is attached to VM /subscriptions/1f90521a-24f6-4758-ac3d-88d869fb0bf5/resourceGroups/packer-acceptance-test/providers/Microsoft.Compute/virtualMachines/pkrvm02e9rzzu5k."
--- FAIL: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group_Additional_Disk (454.00s)
FAIL
FAIL    github.com/hashicorp/packer/builder/azure/arm   454.008s

```

Test results after change
```
--- PASS: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group_Additional_Disk (563.56s)

```

Closes #10070
2020-10-23 13:44:27 -04:00
..
arm builder/azure_arm: Fix build failures due to the deletion of attached managed disks 2020-10-23 13:44:27 -04:00
chroot rework fixer deprecation code so we know what plugins they relate to 2020-10-21 15:28:59 -07:00
common azure arm: make map[string]*string => map[string]string to simplify things (#9985) 2020-09-24 12:19:26 +02:00
dtl review comments, add plugin type for a few missing builders 2020-10-21 16:17:32 -07:00
pkcs12 spelling: unmarshalling 2018-03-14 03:27:22 +00:00
LICENSE Added MIT license 2016-03-14 20:08:35 -07:00
TODO.md Miscellaneous doc improvements 2018-10-18 19:09:49 -04:00