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

Synthetic Monitoring Resource Fixes #237

Merged
merged 4 commits into from
Jul 1, 2021
Merged

Conversation

trotttrotttrott
Copy link
Member

  • Create/update functions return read function call. This was particularly to fix latitude and longitude. The API wants a float32 but schema.TypeFloat only supports float64. The value for each will be different. Without calling read, the value was being stored differently on create than Terraform would expect on subsequent reads when creating execution plans. Calling the read function in create an update will always store the float64 value in state.
  • Leave labels as null if none are set. Attempting to set it as an empty map was causing different behavior on create and read/update. Create set it to null while the latter wanted it to be {}.

This ensures that state is created consistently with the actual
resources.

The lat/lon float32/float64 conversion was making it appear as though
changes were being made outside of Terraform.
Setting labels with an empty map was causing unexpected behavior between
null and {} values in state.
@trotttrotttrott trotttrotttrott requested a review from a team July 1, 2021 20:01
@trotttrotttrott trotttrotttrott merged commit b1af11f into master Jul 1, 2021
@trotttrotttrott trotttrotttrott deleted the ttt/sm-resource-fixes branch July 1, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants