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

Fixed region_backend_service to calc hash using relative path #1491

Merged
merged 2 commits into from
May 22, 2018

Conversation

tmshn
Copy link
Contributor

@tmshn tmshn commented May 15, 2018

Along the change on region_backend_service.backend[].group to use DiffSuppressFunc (#1487), we also need to change hash function, as pointed out.

Fixed this in a same way regular backend services do.
https://github.com/terraform-providers/terraform-provider-google/blob/v1.12.0/google/resource_compute_backend_service_migrate.go#L102-L103

@@ -331,7 +331,8 @@ func resourceGoogleComputeRegionBackendServiceBackendHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})

buf.WriteString(fmt.Sprintf("%s-", m["group"].(string)))
group, _ := getRelativePath(m["group"].(string))
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably still use m["group"] if getRelativePath fails.

@danawillow
Copy link
Contributor

I agree with @emilymye! @tmshn, mind making that change here and also in backend_service? Let me know if you won't have time to do it; since this is a pretty important bugfix I'd like to have it in before our next release (hoping for Monday)

@tmshn
Copy link
Contributor Author

tmshn commented May 18, 2018

Fixed the point: dc71aaf (if I understand you correctly)

@danawillow
Copy link
Contributor

👍 from me! I'll let @emilymye have final say.

@danawillow danawillow merged commit 028ec27 into hashicorp:master May 22, 2018
@ghost
Copy link

ghost commented Nov 18, 2018

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 Nov 18, 2018
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.

3 participants