Skip to content

Commit

Permalink
platform/api/azure: Don't wait for resource group deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
jepio committed Jul 2, 2024
1 parent 8262af9 commit 44fe874
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions platform/api/azure/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ func (a *API) TerminateResourceGroup(name string) error {
opts := &armresources.ResourceGroupsClientBeginDeleteOptions{
ForceDeletionTypes: to.Ptr("Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets"),
}
poller, err := a.rgClient.BeginDelete(context.TODO(), name, opts)
pollOpts := &azruntime.PollUntilDoneOptions{
Frequency: 15 * time.Second,
}
_, err = poller.PollUntilDone(context.TODO(), pollOpts)
_, err := a.rgClient.BeginDelete(context.TODO(), name, opts)
return err
}

Expand Down
5 changes: 1 addition & 4 deletions platform/api/azure/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,9 @@ func (a *API) TerminateInstance(machine *Machine, resourceGroup string) error {
_, err := a.compClient.BeginDelete(context.TODO(), resourceGroup, machine.ID, &armcompute.VirtualMachinesClientBeginDeleteOptions{
ForceDeletion: to.Ptr(true),
})
if err != nil {
return err
}
// We used to wait for the VM to be deleted here, but it's not necessary as
// we will also delete resource group later.
return nil
return err
}

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

0 comments on commit 44fe874

Please sign in to comment.