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 setting 'location' in google_sql_database_instance backup_configuration #4681

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

JamesGuthrie
Copy link
Contributor

@JamesGuthrie JamesGuthrie commented Oct 15, 2019

I would appreciate any feedback on this change. I am a newcomer to go, and to the terraform-provider-google project. I have added the feature to the best of my knowledge, and tested the creation of a new DB, as well as modifying the backup location after creation. I may have broken the tests, but it wasn't clear what I would have to do to get them to run locally.

Closes #4653

`sql`: added `location` field to `backup_configuration` block in `google_sql_database_instance`

@ghost ghost added the size/xs label Oct 15, 2019
Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

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

Hi @JamesGuthrie! The code for this looks good. Would you mind modifying one or more tests to use this new feature? The ones you want are in this file: https://github.com/terraform-providers/terraform-provider-google/blob/master/google/resource_sql_database_instance_test.go. I don't think it's a large enough change to merit its own test, so feel free to use existing ones. I'd recommend leaving at least one test around without the field set in order to check the behavior of what happens when the backup_configuration block is set without a location.

To run the tests, follow the instructions at https://github.com/terraform-providers/terraform-provider-google/blob/master/.github/CONTRIBUTING.md#tests. If it's still unclear, let me know and I'd be happy to run them for you (but hopefully we can improve our documentation in that case!)

@JamesGuthrie
Copy link
Contributor Author

Hi Dana,

thanks for the feedback, I've added the block to one of the existing tests and ran it:

$> make testacc TESTARGS='-run=TestAccSqlDatabaseInstance_highAvailability'
==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccSqlDatabaseInstance_highAvailability -timeout 240m -ldflags="-X=github.com/terraform-providers/terraform-provider-google/version.ProviderVersion=acc"
?   	github.com/terraform-providers/terraform-provider-google	[no test files]
=== RUN   TestAccSqlDatabaseInstance_highAvailability
=== PAUSE TestAccSqlDatabaseInstance_highAvailability
=== CONT  TestAccSqlDatabaseInstance_highAvailability
--- PASS: TestAccSqlDatabaseInstance_highAvailability (601.98s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	602.029s
?   	github.com/terraform-providers/terraform-provider-google/scripts/affectedtests	[no test files]
?   	github.com/terraform-providers/terraform-provider-google/version	[no test files]

If you need me to make any other changes, or if I missed something, please let me know.

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@ghost
Copy link

ghost commented Nov 21, 2019

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 👉 [email protected]. Thanks!

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

Successfully merging this pull request may close these issues.

Add support for backup_configuration.location for CloudSQL instances
2 participants