Skip to content

Commit 81daec8

Browse files
FEAT: Add dependsOn support in cloudrunv2 worker pool (#15444)
1 parent fe095ce commit 81daec8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

mmv1/products/cloudrunv2/WorkerPool.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ examples:
5757
cloud_run_worker_pool_name: 'cloudrun-worker-pool'
5858
ignore_read_extra:
5959
- 'deletion_protection'
60+
- name: 'cloudrunv2_worker_pool_basic_depends_on'
61+
primary_resource_id: 'default'
62+
primary_resource_name: 'fmt.Sprintf("tf-test-cloudrun-worker-pool%s", context["random_suffix"])'
63+
vars:
64+
cloud_run_worker_pool_name: 'cloudrun-worker-pool'
65+
ignore_read_extra:
66+
- 'deletion_protection'
6067
- name: 'cloudrunv2_worker_pool_limits'
6168
primary_resource_id: 'default'
6269
vars:
@@ -413,6 +420,13 @@ properties:
413420
Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references are not supported in Cloud Run.
414421
item_type:
415422
type: String
423+
- name: 'dependsOn'
424+
type: Array
425+
description: |-
426+
Names of the containers that must start before this container.
427+
immutable: true
428+
item_type:
429+
type: String
416430
- name: 'env'
417431
type: Array
418432
description: |-
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
resource "google_cloud_run_v2_worker_pool" "{{$.PrimaryResourceId}}" {
2+
name = "{{index $.Vars "cloud_run_worker_pool_name"}}"
3+
location = "us-central1"
4+
deletion_protection = false
5+
launch_stage = "BETA"
6+
7+
template {
8+
containers {
9+
name = "foo-1"
10+
image = "us-docker.pkg.dev/cloudrun/container/worker-pool"
11+
depends_on = ["foo-2"]
12+
}
13+
containers {
14+
name = "foo-2"
15+
image = "us-docker.pkg.dev/cloudrun/container/worker-pool"
16+
startup_probe {
17+
http_get {
18+
path = "/healthz"
19+
port = 8080
20+
}
21+
period_seconds = 5
22+
timeout_seconds = 2
23+
failure_threshold = 3
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)