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

Change the hash function to be more format tolerant #1750

Merged

Conversation

chrisst
Copy link
Contributor

@chrisst chrisst commented May 10, 2019

The Go json library will parse numbers as floats, however the schema dictates
that these values are integers. In order to be agnostic to to the contents
the ints can be printed directly to strings without needing to be cast first.

I can't test this right now because the backend service API is having a hard time. However here's a proof of concept for how the data should work: https://play.golang.org/p/qFoXogo3FS6

Fixes hashicorp/terraform-provider-google#3590


[all]

[terraform]

[terraform-beta]

[ansible]

[inspec]

@chrisst chrisst requested a review from rileykarson May 10, 2019 20:15
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
This PR seems not to have generated downstream PRs before, as of fea680030b419436191660147d5a93d4fb383ca3.

Pull request statuses

No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#699
depends: GoogleCloudPlatform/terraform-google-conversion#77
depends: hashicorp/terraform-provider-google#3610

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Hmm I wonder how I convinced myself %v wouldn't work in the first place, especially since I used it like a line above lol https://github.com/GoogleCloudPlatform/magic-modules/pull/1750/files#diff-011a1a0eb6ed45e262201b827e9fa4f2L94

tested in CI and tests looked green + logs made sense 👍

@chrisst chrisst force-pushed the backend-service-hash branch from fea6800 to 32d9628 Compare May 10, 2019 23:32
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 32d9628.

Pull request statuses

terraform-provider-google-beta already has an open PR.
terraform-google-conversion already has an open PR.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

chrisst and others added 2 commits May 13, 2019 22:46
The Go json library will parse numbers as floats, however the schema dictates
that these values are integers. In order to be agnostic to to the contents
the ints can be printed directly to strings without needing to be cast first.
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
@modular-magician modular-magician merged commit 95b8ecb into GoogleCloudPlatform:master May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource: google_compute_backend_service: max_rate interface conversion panic
4 participants