Skip to content

Commit

Permalink
r/linux|windows_virtual_machine: opting-out of the force-delete for now
Browse files Browse the repository at this point in the history
This isn't immediately clear, but is only in Preview for now so match the existing behaviour
  • Loading branch information
tombuildsstuff committed Jan 4, 2021
1 parent dfa2658 commit 2a5315b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,10 @@ func resourceLinuxVirtualMachineDelete(d *schema.ResourceData, meta interface{})
log.Printf("[DEBUG] Powered Off Linux Virtual Machine %q (Resource Group %q).", id.Name, id.ResourceGroup)

log.Printf("[DEBUG] Deleting Linux Virtual Machine %q (Resource Group %q)..", id.Name, id.ResourceGroup)
forceDeletion := utils.Bool(skipShutdown) // TODO: support force deletion via a separate feature-flag
// @tombuildsstuff: sending `nil` here omits this value from being sent - which matches
// the previous behaviour - we're only splitting this out so it's clear why
// TODO: support force deletion once it's out of Preview, if applicable
var forceDeletion *bool = nil
deleteFuture, err := client.Delete(ctx, id.ResourceGroup, id.Name, forceDeletion)
if err != nil {
return fmt.Errorf("deleting Linux Virtual Machine %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,10 @@ func resourceWindowsVirtualMachineDelete(d *schema.ResourceData, meta interface{
log.Printf("[DEBUG] Powered Off Windows Virtual Machine %q (Resource Group %q).", id.Name, id.ResourceGroup)

log.Printf("[DEBUG] Deleting Windows Virtual Machine %q (Resource Group %q)..", id.Name, id.ResourceGroup)
forceDeletion := utils.Bool(skipShutdown) // TODO: support force deletion via a separate feature-flag
// @tombuildsstuff: sending `nil` here omits this value from being sent - which matches
// the previous behaviour - we're only splitting this out so it's clear why
// TODO: support force deletion once it's out of Preview, if applicable
var forceDeletion *bool = nil
deleteFuture, err := client.Delete(ctx, id.ResourceGroup, id.Name, forceDeletion)
if err != nil {
return fmt.Errorf("deleting Windows Virtual Machine %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
Expand Down

0 comments on commit 2a5315b

Please sign in to comment.