Predict serviceId based on service runner location #3493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The prediction of the serviceId is based on a hard-coded location (
America/Los_Angeles
) which, when run in a different time zone can cause a date change and the prediction is off by a day. My guess might be that the initial tests were run against theus-west2
Cloud Run location and fully in Terraform Cloud.Example when applying following resource with the
Execution Mode
set toLocal
:I'm presented with the predicted service Id which is a day behind:
"2021-08-08r5" -> "2021-08-07r0"
Rather than setting a hard-coded location, we are utilizing the system Location.
Note
I'm not a go developer and based my proposed change purely on reading the source code and finding the hopeful right use of Location from the Go-Lang time documentation.
Related issue: hashicorp/terraform-provider-google#6713
In draft to allow for discussion around the proposed change