Skip to content

Commit 33bab77

Browse files
fix two tests for cloud_run_service (#4416) (#2902)
Signed-off-by: Modular Magician <[email protected]>
1 parent b38d4da commit 33bab77

File tree

7 files changed

+45
-3
lines changed

7 files changed

+45
-3
lines changed

.changelog/4416.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_cloud_run_domain_mapping.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ project ID or project number.`,
8989
DiffSuppressFunc: cloudrunAnnotationDiffSuppress,
9090
Description: `Annotations is a key value map stored with a resource that
9191
may be set by external tools to store and retrieve arbitrary metadata. More
92-
info: http://kubernetes.io/docs/user-guide/annotations`,
92+
info: http://kubernetes.io/docs/user-guide/annotations
93+
94+
**Note**: The Cloud Run API may add additional annotations that were not provided in your config.
95+
If terraform plan shows a diff where a server-side annotation is added, you can add it to your config
96+
or apply the lifecycle.ignore_changes rule to the metadata.0.annotations field.`,
9397
Elem: &schema.Schema{Type: schema.TypeString},
9498
},
9599
"labels": {

google-beta/resource_cloud_run_service.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@ annotation key.`,
400400
Optional: true,
401401
Description: `Annotations is a key value map stored with a resource that
402402
may be set by external tools to store and retrieve arbitrary metadata. More
403-
info: http://kubernetes.io/docs/user-guide/annotations`,
403+
info: http://kubernetes.io/docs/user-guide/annotations
404+
405+
**Note**: The Cloud Run API may add additional annotations that were not provided in your config.
406+
If terraform plan shows a diff where a server-side annotation is added, you can add it to your config
407+
or apply the lifecycle.ignore_changes rule to the metadata.0.annotations field.`,
404408
Elem: &schema.Schema{Type: schema.TypeString},
405409
},
406410
"labels": {
@@ -510,7 +514,11 @@ and annotations.`,
510514
DiffSuppressFunc: cloudrunAnnotationDiffSuppress,
511515
Description: `Annotations is a key value map stored with a resource that
512516
may be set by external tools to store and retrieve arbitrary metadata. More
513-
info: http://kubernetes.io/docs/user-guide/annotations`,
517+
info: http://kubernetes.io/docs/user-guide/annotations
518+
519+
**Note**: The Cloud Run API may add additional annotations that were not provided in your config.
520+
If terraform plan shows a diff where a server-side annotation is added, you can add it to your config
521+
or apply the lifecycle.ignore_changes rule to the metadata.0.annotations field.`,
514522
Elem: &schema.Schema{Type: schema.TypeString},
515523
},
516524
"labels": {

google-beta/resource_cloud_run_service_generated_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ resource "google_cloud_run_service" "default" {
264264
latest_revision = true
265265
}
266266
autogenerate_revision_name = true
267+
268+
lifecycle {
269+
ignore_changes = [
270+
metadata.0.annotations,
271+
]
272+
}
267273
}
268274
`, context)
269275
}

google-beta/resource_cloud_run_service_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ resource "google_cloud_run_service" "default" {
7070
percent = 100
7171
latest_revision = true
7272
}
73+
74+
lifecycle {
75+
ignore_changes = [
76+
metadata.0.annotations,
77+
]
78+
}
7379
}
7480
`, name, project, concurrency, timeoutSeconds)
7581
}

website/docs/r/cloud_run_domain_mapping.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ The `metadata` block supports:
155155
Annotations is a key value map stored with a resource that
156156
may be set by external tools to store and retrieve arbitrary metadata. More
157157
info: http://kubernetes.io/docs/user-guide/annotations
158+
**Note**: The Cloud Run API may add additional annotations that were not provided in your config.
159+
If terraform plan shows a diff where a server-side annotation is added, you can add it to your config
160+
or apply the lifecycle.ignore_changes rule to the metadata.0.annotations field.
158161

159162
- - -
160163

website/docs/r/cloud_run_service.html.markdown

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ resource "google_cloud_run_service" "default" {
191191
latest_revision = true
192192
}
193193
autogenerate_revision_name = true
194+
195+
lifecycle {
196+
ignore_changes = [
197+
metadata.0.annotations,
198+
]
199+
}
194200
}
195201
```
196202
## Example Usage - Cloud Run Service Traffic Split
@@ -318,6 +324,9 @@ The `metadata` block supports:
318324
Annotations is a key value map stored with a resource that
319325
may be set by external tools to store and retrieve arbitrary metadata. More
320326
info: http://kubernetes.io/docs/user-guide/annotations
327+
**Note**: The Cloud Run API may add additional annotations that were not provided in your config.
328+
If terraform plan shows a diff where a server-side annotation is added, you can add it to your config
329+
or apply the lifecycle.ignore_changes rule to the metadata.0.annotations field.
321330

322331
* `name` -
323332
(Optional)
@@ -612,6 +621,9 @@ The `metadata` block supports:
612621
Annotations is a key value map stored with a resource that
613622
may be set by external tools to store and retrieve arbitrary metadata. More
614623
info: http://kubernetes.io/docs/user-guide/annotations
624+
**Note**: The Cloud Run API may add additional annotations that were not provided in your config.
625+
If terraform plan shows a diff where a server-side annotation is added, you can add it to your config
626+
or apply the lifecycle.ignore_changes rule to the metadata.0.annotations field.
615627

616628
## Attributes Reference
617629

0 commit comments

Comments
 (0)