Skip to content

Commit 44fe874

Browse files
author
Jeremi Piotrowski
committed
platform/api/azure: Don't wait for resource group deletion
1 parent 8262af9 commit 44fe874

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

platform/api/azure/groups.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ func (a *API) TerminateResourceGroup(name string) error {
5858
opts := &armresources.ResourceGroupsClientBeginDeleteOptions{
5959
ForceDeletionTypes: to.Ptr("Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"),
6060
}
61-
poller, err := a.rgClient.BeginDelete(context.TODO(), name, opts)
62-
pollOpts := &azruntime.PollUntilDoneOptions{
63-
Frequency: 15 * time.Second,
64-
}
65-
_, err = poller.PollUntilDone(context.TODO(), pollOpts)
61+
_, err := a.rgClient.BeginDelete(context.TODO(), name, opts)
6662
return err
6763
}
6864

platform/api/azure/instance.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,9 @@ func (a *API) TerminateInstance(machine *Machine, resourceGroup string) error {
294294
_, err := a.compClient.BeginDelete(context.TODO(), resourceGroup, machine.ID, &armcompute.VirtualMachinesClientBeginDeleteOptions{
295295
ForceDeletion: to.Ptr(true),
296296
})
297-
if err != nil {
298-
return err
299-
}
300297
// We used to wait for the VM to be deleted here, but it's not necessary as
301298
// we will also delete resource group later.
302-
return nil
299+
return err
303300
}
304301

305302
func (a *API) GetConsoleOutput(name, resourceGroup, storageAccount string) ([]byte, error) {

0 commit comments

Comments
 (0)