-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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/digitalocean: Support disk only resize #13059
Conversation
Allow to resize a droplet permanently (i.e. apply disk resize) if previously it was resized temporarily (CPU and RAM only). Fixes: #13007 ``` $ make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanDroplet_ResizeOnlyDisk' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/03/25 03:54:23 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanDroplet_ResizeOnlyDisk -timeout 120m === RUN TestAccDigitalOceanDroplet_ResizeOnlyDisk --- PASS: TestAccDigitalOceanDroplet_ResizeOnlyDisk (198.62s) PASS ok github.com/hashicorp/terraform/builtin/providers/digitalocean 198.638s ```
@@ -144,6 +144,56 @@ func TestAccDigitalOceanDroplet_ResizeWithOutDisk(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccDigitalOceanDroplet_ResizeOnlyDisk(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to merge this test into TestAccDigitalOceanDroplet_ResizeWithOutDisk
as it's the strict superset of the latter (and name it just TestAccDigitalOceanDroplet_Resize
).
|
||
if err != nil { | ||
// Wait for the resize action to complete. | ||
if err := waitForAction(client, action); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed WaitForDropletAttribute
to waitForAction
, because we don't know what disk size value to wait for, as it's not available from a resource configuration – all we've got is a size
value, but it represents RAM size, not disk size.
So the only way is to wait for a resize action to complete.
Hi @skovorodkin This LGTM! The associated tests pass as expected as well :)
Thanks for the work here - I will look into the tests to see what can be merged Paul |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Allow to resize a droplet permanently (i.e. apply disk resize)
if previously it was resized temporarily (CPU and RAM only).
Fixes: #13007