Skip to content

Commit 35fce45

Browse files
Remove beta from the Cloud Run Service dependsOn container field (#9496) (#16577)
[upstream:064da4a296663f8b9b213fa667b843c4674f1913] Signed-off-by: Modular Magician <[email protected]>
1 parent 2e84b0e commit 35fce45

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.changelog/9496.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
cloudrunv2: promoted field `depends_on` in `google_cloud_run_v2_service` to GA
3+
```

google/services/cloudrunv2/resource_cloud_run_v2_service.go

+24
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ This field follows Kubernetes annotations' namespacing, limits, and rules.`,
113113
Type: schema.TypeString,
114114
},
115115
},
116+
"depends_on": {
117+
Type: schema.TypeList,
118+
Optional: true,
119+
Description: `Containers which should be started before this container. If specified the container will wait to start until all containers with the listed names are healthy.`,
120+
Elem: &schema.Schema{
121+
Type: schema.TypeString,
122+
},
123+
},
116124
"env": {
117125
Type: schema.TypeList,
118126
Optional: true,
@@ -1800,6 +1808,7 @@ func flattenCloudRunV2ServiceTemplateContainers(v interface{}, d *schema.Resourc
18001808
"working_dir": flattenCloudRunV2ServiceTemplateContainersWorkingDir(original["workingDir"], d, config),
18011809
"liveness_probe": flattenCloudRunV2ServiceTemplateContainersLivenessProbe(original["livenessProbe"], d, config),
18021810
"startup_probe": flattenCloudRunV2ServiceTemplateContainersStartupProbe(original["startupProbe"], d, config),
1811+
"depends_on": flattenCloudRunV2ServiceTemplateContainersDependsOn(original["dependsOn"], d, config),
18031812
})
18041813
}
18051814
return transformed
@@ -2385,6 +2394,10 @@ func flattenCloudRunV2ServiceTemplateContainersStartupProbeGrpcService(v interfa
23852394
return v
23862395
}
23872396

2397+
func flattenCloudRunV2ServiceTemplateContainersDependsOn(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
2398+
return v
2399+
}
2400+
23882401
func flattenCloudRunV2ServiceTemplateVolumes(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
23892402
if v == nil {
23902403
return v
@@ -3214,6 +3227,13 @@ func expandCloudRunV2ServiceTemplateContainers(v interface{}, d tpgresource.Terr
32143227
transformed["startupProbe"] = transformedStartupProbe
32153228
}
32163229

3230+
transformedDependsOn, err := expandCloudRunV2ServiceTemplateContainersDependsOn(original["depends_on"], d, config)
3231+
if err != nil {
3232+
return nil, err
3233+
} else if val := reflect.ValueOf(transformedDependsOn); val.IsValid() && !tpgresource.IsEmptyValue(val) {
3234+
transformed["dependsOn"] = transformedDependsOn
3235+
}
3236+
32173237
req = append(req, transformed)
32183238
}
32193239
return req, nil
@@ -3881,6 +3901,10 @@ func expandCloudRunV2ServiceTemplateContainersStartupProbeGrpcService(v interfac
38813901
return v, nil
38823902
}
38833903

3904+
func expandCloudRunV2ServiceTemplateContainersDependsOn(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
3905+
return v, nil
3906+
}
3907+
38843908
func expandCloudRunV2ServiceTemplateVolumes(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
38853909
l := v.([]interface{})
38863910
req := make([]interface{}, 0, len(l))

website/docs/r/cloud_run_v2_service.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ The following arguments are supported:
538538
Structure is [documented below](#nested_startup_probe).
539539

540540
* `depends_on` -
541-
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
541+
(Optional)
542542
Containers which should be started before this container. If specified the container will wait to start until all containers with the listed names are healthy.
543543

544544

0 commit comments

Comments
 (0)