terraform-provider-google
terraform-provider-google copied to clipboard
Failing test(s): TestAccMonitoringMetricDescriptor_update (permadiff)
Failure rate: 100% since 7/15/2022
Impacted tests:
- TestAccMonitoringMetricDescriptor_update
Nightly builds:
- https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloud_ProviderGoogleCloudGoogleProject/315760?buildTab=tests&expandedTest=-1336336578166089859
Message:
# google_monitoring_metric_descriptor.basic will be updated in-place
~ resource "google_monitoring_metric_descriptor" "basic" {
id = "projects/project-id/metricDescriptors/custom.googleapis.com/stores/daily_sales"
name = "projects/project-id/metricDescriptors/custom.googleapis.com/stores/daily_sales"
# (9 unchanged attributes hidden)
- labels {
- description = "description1" -> null
- key = "key1" -> null
- value_type = "STRING" -> null
}
This is a real permadiff but it's not a breaking change since the labels field isn't ForceNew. I don't see any changes in the provider that would've caused this so it's probably an api-side change.
Specifically, it looks like the API is not properly updating the labels to remove the old label:
---[ REQUEST ]---------------------------------------
POST /v3/projects/project-id/metricDescriptors?alt=json HTTP/1.1
Host: monitoring.googleapis.com
User-Agent: Terraform/1.2.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
Content-Length: 347
Content-Type: application/json
Accept-Encoding: gzip
{
"description": "Daily sales records from all branch stores.",
"displayName": "daily sales",
"labels": [
{
"description": "description2",
"key": "key2",
"valueType": "INT64"
}
],
"launchStage": "BETA",
"metadata": {
"ingestDelay": "60s",
"samplePeriod": "60s"
},
"metricKind": "GAUGE",
"type": "custom.googleapis.com/stores/daily_sales",
"unit": "{USD}",
"valueType": "DOUBLE"
}
-----------------------------------------------------
2022/07/20 14:15:11 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 20 Jul 2022 14:15:11 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0
{
"name": "projects/project-id/metricDescriptors/custom.googleapis.com/stores/daily_sales",
"labels": [
{
"key": "key2",
"valueType": "INT64",
"description": "description2"
},
{
"key": "key1",
"description": "description1"
}
],
"metricKind": "GAUGE",
"valueType": "DOUBLE",
"unit": "{USD}",
"description": "Daily sales records from all branch stores.",
"displayName": "daily sales",
"type": "custom.googleapis.com/stores/daily_sales",
"metadata": {
"samplePeriod": "60s",
"ingestDelay": "60s"
},
"launchStage": "BETA"
}
Oddly, this api doesn't actually seem to officially support updates at all - only create & delete. So it's odd that we're a) allowing update, and b) treating the update as an update https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/create
b/239950166
b/239950421
- TestAccMonitoringMetricDescriptor_update Google Cloud - 100% failure Google Cloud Beta - 100% failure
b/261813022
The permadiff for this test has gotten longer.
The change here is that the labels field should either be ForceNew or output-only - see b/ tickets for more details.
closed with https://github.com/GoogleCloudPlatform/magic-modules/pull/8914
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.