Skip to content

Commit 98c0f20

Browse files
Deprecate liveness_probe.tcp_socket field from google_cloud_run_v2_service (#7158) (#5128)
Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent 75c5592 commit 98c0f20

File tree

4 files changed

+13
-57
lines changed

4 files changed

+13
-57
lines changed

.changelog/7158.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:deprecation
2+
cloudrunv2: deprecated `liveness_probe.tcp_socket` field from `google_cloud_run_v2_service` resource as it is not supported by the API and it will be removed in a future major release
3+
```

google-beta/resource_cloud_run_v2_service.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func resourceCloudRunV2Service() *schema.Resource {
153153
"http_get": {
154154
Type: schema.TypeList,
155155
Optional: true,
156-
Description: `HTTPGet specifies the http request to perform. Exactly one of HTTPGet or TCPSocket must be specified.`,
156+
Description: `HTTPGet specifies the http request to perform.`,
157157
MaxItems: 1,
158158
Elem: &schema.Resource{
159159
Schema: map[string]*schema.Schema{
@@ -201,7 +201,8 @@ func resourceCloudRunV2Service() *schema.Resource {
201201
"tcp_socket": {
202202
Type: schema.TypeList,
203203
Optional: true,
204-
Description: `TCPSocket specifies an action involving a TCP port. Exactly one of HTTPGet or TCPSocket must be specified.`,
204+
Deprecated: "Cloud Run does not support tcp socket in liveness probe and `liveness_probe.tcp_socket` field will be removed in a future major release.",
205+
Description: `TCPSocket specifies an action involving a TCP port. This field is not supported in liveness probe currently.`,
205206
MaxItems: 1,
206207
Elem: &schema.Resource{
207208
Schema: map[string]*schema.Schema{

google-beta/resource_cloud_run_v2_service_test.go

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,6 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceProbesUpdate(t *testing.T) {
229229
ImportStateVerify: true,
230230
ImportStateVerifyIgnore: []string{"name", "location"},
231231
},
232-
{
233-
Config: testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithHTTPStartupProbeAndTCPLivenessProbe(context),
234-
},
235-
{
236-
ResourceName: "google_cloud_run_v2_service.default",
237-
ImportState: true,
238-
ImportStateVerify: true,
239-
ImportStateVerifyIgnore: []string{"name", "location"},
240-
},
241232
{
242233
Config: testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithEmptyHTTPStartupProbe(context),
243234
},
@@ -327,49 +318,6 @@ resource "google_cloud_run_v2_service" "default" {
327318
`, context)
328319
}
329320

330-
func testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithHTTPStartupProbeAndTCPLivenessProbe(context map[string]interface{}) string {
331-
return Nprintf(`
332-
resource "google_cloud_run_v2_service" "default" {
333-
name = "tf-test-cloudrun-service%{random_suffix}"
334-
location = "us-central1"
335-
336-
template {
337-
containers {
338-
image = "us-docker.pkg.dev/cloudrun/container/hello"
339-
ports {
340-
container_port = 8080
341-
}
342-
startup_probe {
343-
initial_delay_seconds = 3
344-
period_seconds = 2
345-
timeout_seconds = 6
346-
failure_threshold = 3
347-
http_get {
348-
path = "/some-path"
349-
http_headers {
350-
name = "User-Agent"
351-
value = "magic-modules"
352-
}
353-
http_headers {
354-
name = "Some-Name"
355-
}
356-
}
357-
}
358-
liveness_probe {
359-
initial_delay_seconds = 3
360-
period_seconds = 2
361-
timeout_seconds = 6
362-
failure_threshold = 3
363-
tcp_socket {
364-
port = 8080
365-
}
366-
}
367-
}
368-
}
369-
}
370-
`, context)
371-
}
372-
373321
func testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithEmptyHTTPStartupProbe(context map[string]interface{}) string {
374322
return Nprintf(`
375323
resource "google_cloud_run_v2_service" "default" {
@@ -398,6 +346,10 @@ resource "google_cloud_run_v2_service" "default" {
398346
containers {
399347
image = "us-docker.pkg.dev/cloudrun/container/hello"
400348
startup_probe {
349+
initial_delay_seconds = 3
350+
period_seconds = 2
351+
timeout_seconds = 6
352+
failure_threshold = 3
401353
http_get {
402354
path = "/some-path"
403355
http_headers {

website/docs/r/cloud_run_v2_service.html.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,12 @@ The following arguments are supported:
510510

511511
* `http_get` -
512512
(Optional)
513-
HTTPGet specifies the http request to perform. Exactly one of HTTPGet or TCPSocket must be specified.
513+
HTTPGet specifies the http request to perform.
514514
Structure is [documented below](#nested_http_get).
515515

516516
* `tcp_socket` -
517-
(Optional)
518-
TCPSocket specifies an action involving a TCP port. Exactly one of HTTPGet or TCPSocket must be specified.
517+
(Optional, Deprecated)
518+
TCPSocket specifies an action involving a TCP port. This field is not supported in liveness probe currently.
519519
Structure is [documented below](#nested_tcp_socket).
520520

521521

0 commit comments

Comments
 (0)