Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
purge bs when destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
onokatio committed Dec 28, 2019
1 parent a43597e commit 0c8d37b
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions BlockStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,24 @@ func resource_n0stack_blockstorage_delete(d *schema.ResourceData, meta interface
defer conn.Close()

client := pprovisioning.NewBlockStorageServiceClient(conn)
request := pprovisioning.DeleteBlockStorageRequest{
Name: d.Get("blockstorage_name").(string) ,
{
request := pprovisioning.DeleteBlockStorageRequest{
Name: d.Get("blockstorage_name").(string) ,
}
_, err = client.DeleteBlockStorage(context.Background(), &request)
if err != nil {
return err
}
}
_, err = client.DeleteBlockStorage(context.Background(), &request)
if err != nil {
return err
{
request := pprovisioning.PurgeBlockStorageRequest{
Name: d.Get("blockstorage_name").(string) ,
}
_, err = client.PurgeBlockStorage(context.Background(), &request)
if err != nil {
return err
}
}

return nil
}

0 comments on commit 0c8d37b

Please sign in to comment.