Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/openstack: Handle volumes in "deleting" state #4204

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,13 @@ func resourceBlockStorageVolumeV1Delete(d *schema.ResourceData, meta interface{}
}
}

err = volumes.Delete(blockStorageClient, d.Id()).ExtractErr()
if err != nil {
return fmt.Errorf("Error deleting OpenStack volume: %s", err)
// It's possible that this volume was used as a boot device and is currently
// in a "deleting" state from when the instance was terminated.
// If this is true, just move on. It'll eventually delete.
if v.Status != "deleting" {
if err := volumes.Delete(blockStorageClient, d.Id()).ExtractErr(); err != nil {
return CheckDeleted(d, err, "volume")
}
}

// Wait for the volume to delete before moving on.
Expand Down