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

Fix disk type’Malformed URL’ error #275

Merged
merged 3 commits into from
Aug 1, 2017
Merged

Fix disk type’Malformed URL’ error #275

merged 3 commits into from
Aug 1, 2017

Conversation

sl1pm4t
Copy link
Contributor

@sl1pm4t sl1pm4t commented Aug 1, 2017

The API expects the disk type to be a SelfLink URL, but the disk type
name was being used (e.g. “pd-ssd”). This resulted in the following error:

Error applying plan:

1 error(s) occurred:

* google_compute_instance.foo: 1 error(s) occurred:

* google_compute_instance.foo: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.disks[0].initializeParams.diskType': 'pd-ssd'. The URL is malformed., invalid

The API expects the disk type to be a SelfLink URL, but the disk type 
name was being used (e.g. “pd-ssd”).
@sl1pm4t
Copy link
Contributor Author

sl1pm4t commented Aug 1, 2017

Please review @danawillow
Thanks!

@danawillow
Copy link
Contributor

Thanks @sl1pm4t! Wish we had caught this with a test instead :-/ Mind adding (or modifying) a test that sets type?

@sl1pm4t
Copy link
Contributor Author

sl1pm4t commented Aug 1, 2017

Sure thing @danawillow

zone = "us-central1-a"

boot_disk {
initialize_params {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the indentation here? It should be tabs.

@sl1pm4t
Copy link
Contributor Author

sl1pm4t commented Aug 1, 2017

Oops - that test doesn't work.

The Instance data does not contain the actual disk type, just "PERSISTENT". This commit uses the computeClient to pull the disk data from the API, allowing checking of the disk type.

Also fmt'd the test configuration.
@danawillow
Copy link
Contributor

Thanks, looks good!

@danawillow danawillow merged commit 0595ef2 into hashicorp:master Aug 1, 2017
z1nkum pushed a commit to z1nkum/terraform-provider-google that referenced this pull request Aug 15, 2017
* Fix disk type’Malformed URL’ error

The API expects the disk type to be a SelfLink URL, but the disk type 
name was being used (e.g. “pd-ssd”).

* Add ACC Tests for boot disk type

* Fix acceptance test & fmt test config

The Instance data does not contain the actual disk type, just "PERSISTENT". This commit uses the computeClient to pull the disk data from the API, allowing checking of the disk type.

Also fmt'd the test configuration.
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
* Fix disk type’Malformed URL’ error

The API expects the disk type to be a SelfLink URL, but the disk type 
name was being used (e.g. “pd-ssd”).

* Add ACC Tests for boot disk type

* Fix acceptance test & fmt test config

The Instance data does not contain the actual disk type, just "PERSISTENT". This commit uses the computeClient to pull the disk data from the API, allowing checking of the disk type.

Also fmt'd the test configuration.
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @danawillow
@ghost
Copy link

ghost commented Mar 31, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants