Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove beta min_version from the Cloud Run Service depends_on container field #16577

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9496.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
cloudrunv2: promoted field `depends_on` in `google_cloud_run_v2_service` to GA
```
24 changes: 24 additions & 0 deletions google/services/cloudrunv2/resource_cloud_run_v2_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ This field follows Kubernetes annotations' namespacing, limits, and rules.`,
Type: schema.TypeString,
},
},
"depends_on": {
Type: schema.TypeList,
Optional: true,
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.`,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"env": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -1800,6 +1808,7 @@ func flattenCloudRunV2ServiceTemplateContainers(v interface{}, d *schema.Resourc
"working_dir": flattenCloudRunV2ServiceTemplateContainersWorkingDir(original["workingDir"], d, config),
"liveness_probe": flattenCloudRunV2ServiceTemplateContainersLivenessProbe(original["livenessProbe"], d, config),
"startup_probe": flattenCloudRunV2ServiceTemplateContainersStartupProbe(original["startupProbe"], d, config),
"depends_on": flattenCloudRunV2ServiceTemplateContainersDependsOn(original["dependsOn"], d, config),
})
}
return transformed
Expand Down Expand Up @@ -2385,6 +2394,10 @@ func flattenCloudRunV2ServiceTemplateContainersStartupProbeGrpcService(v interfa
return v
}

func flattenCloudRunV2ServiceTemplateContainersDependsOn(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}

func flattenCloudRunV2ServiceTemplateVolumes(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
if v == nil {
return v
Expand Down Expand Up @@ -3214,6 +3227,13 @@ func expandCloudRunV2ServiceTemplateContainers(v interface{}, d tpgresource.Terr
transformed["startupProbe"] = transformedStartupProbe
}

transformedDependsOn, err := expandCloudRunV2ServiceTemplateContainersDependsOn(original["depends_on"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedDependsOn); val.IsValid() && !tpgresource.IsEmptyValue(val) {
transformed["dependsOn"] = transformedDependsOn
}

req = append(req, transformed)
}
return req, nil
Expand Down Expand Up @@ -3881,6 +3901,10 @@ func expandCloudRunV2ServiceTemplateContainersStartupProbeGrpcService(v interfac
return v, nil
}

func expandCloudRunV2ServiceTemplateContainersDependsOn(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandCloudRunV2ServiceTemplateVolumes(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
l := v.([]interface{})
req := make([]interface{}, 0, len(l))
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/cloud_run_v2_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ The following arguments are supported:
Structure is [documented below](#nested_startup_probe).

* `depends_on` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
(Optional)
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.


Expand Down