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

provider/google: Support for unmanaged instance groups (google_compute_instance_group) #4087

Merged
merged 1 commit into from
Feb 26, 2016

Conversation

ajcrowe
Copy link

@ajcrowe ajcrowe commented Nov 27, 2015

I've added support for creating unmanaged Google Instance Groups. I've not been able to complete the suite of acceptance tests but I think they should work.

I've used a couple of functions found in google_compute_target_pool.go

Is having a dependency on these ok?

Let me know if anything needs changing more than happy to amend.

@ajcrowe ajcrowe changed the title Support for google_compute_instance_group resource Google Cloud - Support for Unmanaged Instance Groups (google_compute_instance_group) Nov 27, 2015
@ajcrowe ajcrowe changed the title Google Cloud - Support for Unmanaged Instance Groups (google_compute_instance_group) provider/google: Support for unmanaged instance groups (google_compute_instance_group) Nov 27, 2015
@ajcrowe ajcrowe force-pushed the google-instance_groups branch from 2ea63ea to 98761be Compare November 28, 2015 10:02
Elem: &schema.Schema{Type: schema.TypeString},
},

"network": &schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the API docs, this is not computed

Copy link
Author

Choose a reason for hiding this comment

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

This is strange, the library docs list it as [Output Only] see https://godoc.org/google.golang.org/api/compute/v1#InstanceGroup

From my testing the adding of instances will populate the network into the state. or leave it blank should no instance be defined when it's created.

If you later add instance the network is populated correctly. However the network remains even after all instances are removed, this could be something to change?

@lwander
Copy link
Contributor

lwander commented Jan 19, 2016

@ajcrowe Provided tests all pass? LGTM, could you squash before I merge?

@ajcrowe ajcrowe force-pushed the google-instance_groups branch 2 times, most recently from 97f4b58 to 08bdd77 Compare February 2, 2016 17:48
@ajcrowe
Copy link
Author

ajcrowe commented Feb 2, 2016

I've squashed the commit and rebased to master. I've also removed the getNamedPorts function as this was pull into an update to the google_compute_instance_group_manager resource.

I've updated the docs to reflect the need to always use full self_link urls for instances and added a simple check for this. If you need any other changes let me know

@lwander
Copy link
Contributor

lwander commented Feb 2, 2016

Sweet! One last tiny nitpick - could you reformat your test configs to take a name parameter like here, and pass in a name with a random suffix like so? The motivation is explained in #4514. Your current chosen names shouldn't cause any conflicts, but we'd like to adopt this practice for all tests just in case.

@ajcrowe ajcrowe force-pushed the google-instance_groups branch from 08bdd77 to 9476cd1 Compare February 10, 2016 12:58
@ajcrowe
Copy link
Author

ajcrowe commented Feb 10, 2016

I've updated the acctests, I haven't been able to run them myself so please let me know if they are broken.

@lwander
Copy link
Contributor

lwander commented Feb 22, 2016

The tests are broken, 1, you're missing quotes around the instances resource you are referencing with ${}, and 2, those instances need to exist for the test to pass.

@ajcrowe ajcrowe force-pushed the google-instance_groups branch 2 times, most recently from 4288326 to 076797d Compare February 26, 2016 11:39
@ajcrowe
Copy link
Author

ajcrowe commented Feb 26, 2016

This should be sorted now, sorry for the oversight!

@ajcrowe ajcrowe force-pushed the google-instance_groups branch from 076797d to b3f7d1e Compare February 26, 2016 18:41
@ajcrowe
Copy link
Author

ajcrowe commented Feb 26, 2016

Thanks @lwander, sorry I missed this! I've pull your change in.

lwander added a commit that referenced this pull request Feb 26, 2016
provider/google: Support for unmanaged instance groups (google_compute_instance_group)
@lwander lwander merged commit 6a8c814 into hashicorp:master Feb 26, 2016
@lwander
Copy link
Contributor

lwander commented Feb 26, 2016

All set! sorry for the long wait.

@ajcrowe
Copy link
Author

ajcrowe commented Feb 27, 2016

No worries Lars, pleased I could contribute to a great tool.

@ghost
Copy link

ghost commented Apr 27, 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 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.

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

Successfully merging this pull request may close these issues.

4 participants