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: fix container instance group URLs #12486

Merged
merged 1 commit into from
Mar 13, 2017

Conversation

paddycarver
Copy link
Contributor

Google Container Engine's cluster API returned instance group manager
URLs when it meant to return instance group URLs. See #4336 for details
about the bug.

While this is undeniably an upstream problem, this PR:

  • detects the error, meaning it will work as expected when the API is
    fixed.
  • corrects the error by requesting the instance group manager, then
    retrieving its instance group URL, and using that instead.
  • adds a test that exercises the error and the solution, to ensure it is
    functioning properly.

Unit test without fix:

=== RUN   TestAccContainerCluster_backend
--- FAIL: TestAccContainerCluster_backend (303.57s)
        testing.go:265: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_backend_service.my-backend-service: 1 error(s) occurred:

                * google_compute_backend_service.my-backend-service: Error creating backend service: googleapi: Error 400: Invalid value for field 'resource.backends[0].group': 'https://www.googleapis.com/compute/v1/projects/hc-terraform-testing/zones/us-central1-c/instanceGroupManagers/gke-terraform-test-evnwj-default-pool-68b6a1a7-grp'. The value is not a valid resourceView nor instanceGroup URL., invalid
FAIL

Unit test with fix:

=== RUN   TestAccContainerCluster_backend
--- PASS: TestAccContainerCluster_backend (298.37s)

Google Container Engine's cluster API returned instance group manager
URLs when it meant to return instance group URLs. See #4336 for details
about the bug.

While this is undeniably an upstream problem, this PR:

* detects the error, meaning it will work as expected when the API is
  fixed.
* corrects the error by requesting the instance group manager, then
  retrieving its instance group URL, and using that instead.
* adds a test that exercises the error and the solution, to ensure it is
  functioning properly.
Copy link
Contributor

@lwander lwander left a comment

Choose a reason for hiding this comment

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

Nice, LGTM. Let's leave this open briefly before merging to see if anyone else from that open bug wants to weigh in.

@paddycarver
Copy link
Contributor Author

Going to go ahead and merge this one now. :)

@ghost
Copy link

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

2 participants