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

Support compute reservation resize #3308

Merged

Conversation

megan07
Copy link
Contributor

@megan07 megan07 commented Mar 26, 2020

Fixes hashicorp/terraform-provider-google#4937

Release Note Template for Downstream PRs (will be copied)

compute: added ability to resize `google_compute_reservation`

@megan07 megan07 changed the title Megan reservation resize Support compute reservation resize Mar 26, 2020
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 115 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 115 insertions(+), 2 deletions(-))
Ansible: Diff ( 1 file changed, 18 insertions(+), 5 deletions(-))

@megan07 megan07 requested a review from chrisst March 26, 2020 17:25
Copy link
Contributor

@chrisst chrisst left a comment

Choose a reason for hiding this comment

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

Looking at the downstream this api is following the update with computeOperationWaitTime as though the API returned an operation object. But the API docs don't make it sound like this API supports operations. Also the API has invented it's own error output, which makes me think that they might return an error in a way we won't capture correctly at this time. Can you confirm that bad input (-1 count? stupid large count) returns an actionable error to the user?

ImportStateVerify: true,
},
{
Config: testAccComputeReservation_basic(reservationName, "1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you update to 0? Is that a valid reservation count?

templates/terraform/update_encoder/reservation.go.erb Outdated Show resolved Hide resolved
@chrisst
Copy link
Contributor

chrisst commented Mar 27, 2020

Adding @rambleraptor as I'm not confident the ansible code will work as is right now since there isn't any ansible update encoder modification.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 119 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 119 insertions(+), 5 deletions(-))
Ansible: Diff ( 1 file changed, 18 insertions(+), 5 deletions(-))

@megan07 megan07 requested a review from chrisst March 27, 2020 19:08
@rambleraptor
Copy link
Contributor

I'm not terribly worried about this for now. I'll give you a green check so you can unblock Terraform.

@megan07
Copy link
Contributor Author

megan07 commented Mar 27, 2020

Looking at the downstream this api is following the update with computeOperationWaitTime as though the API returned an operation object. But the API docs don't make it sound like this API supports operations. Also the API has invented it's own error output, which makes me think that they might return an error in a way we won't capture correctly at this time. Can you confirm that bad input (-1 count? stupid large count) returns an actionable error to the user?

I tested with a -1 and it the error returned is clear: Error updating Reservation googleapi: Error 400: Invalid value for field 'specificSkuCount': '-1'. Must be greater than or equal to 1, invalid

@megan07 megan07 merged commit 7b67854 into GoogleCloudPlatform:master Mar 27, 2020
nathkn pushed a commit to nathkn/magic-modules that referenced this pull request May 18, 2020
* support compute reservations resize

* remove if custom encoder

* review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support compute.reservations.resize
5 participants