Skip to content

Commit bc59ff8

Browse files
authored
feat: promote service scaling to GA in cloudrunv2 Service resource (#11794)
1 parent 771215e commit bc59ff8

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

mmv1/products/cloudrunv2/Service.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ properties:
322322
item_type: Api::Type::String
323323
- !ruby/object:Api::Type::NestedObject
324324
name: 'scaling'
325-
min_version: beta
326325
description: |
327326
Scaling settings that apply to the whole service
328327
properties:

mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb

+73-3
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,6 @@ resource "google_cloud_run_v2_service" "default" {
971971
`, context)
972972
}
973973

974-
<% unless version == 'ga' -%>
975974
func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testing.T) {
976975
t.Parallel()
977976
context := map[string]interface{} {
@@ -983,7 +982,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testin
983982
CheckDestroy: testAccCheckCloudRunV2ServiceDestroyProducer(t),
984983
Steps: []resource.TestStep{
985984
{
986-
Config: testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled(context),
985+
Config: testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstances(context),
987986
},
988987
{
989988
ResourceName: "google_cloud_run_v2_service.default",
@@ -1012,7 +1011,6 @@ resource "google_cloud_run_v2_service" "default" {
10121011
description = "description creating"
10131012
location = "us-central1"
10141013
deletion_protection = false
1015-
launch_stage = "BETA"
10161014
annotations = {
10171015
generated-by = "magic-modules"
10181016
}
@@ -1037,6 +1035,77 @@ resource "google_cloud_run_v2_service" "default" {
10371035

10381036
`, context)
10391037
}
1038+
func testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstances(context map[string]interface{}) string {
1039+
return acctest.Nprintf(`
1040+
resource "google_cloud_run_v2_service" "default" {
1041+
name = "tf-test-cloudrun-service%{random_suffix}"
1042+
description = "description creating"
1043+
location = "us-central1"
1044+
deletion_protection = false
1045+
annotations = {
1046+
generated-by = "magic-modules"
1047+
}
1048+
ingress = "INGRESS_TRAFFIC_ALL"
1049+
labels = {
1050+
label-1 = "value-1"
1051+
}
1052+
client = "client-1"
1053+
client_version = "client-version-1"
1054+
scaling {
1055+
min_instance_count = 1
1056+
}
1057+
template {
1058+
containers {
1059+
name = "container-1"
1060+
image = "us-docker.pkg.dev/cloudrun/container/hello"
1061+
}
1062+
}
1063+
lifecycle {
1064+
ignore_changes = [
1065+
launch_stage,
1066+
]
1067+
}
1068+
}
1069+
1070+
`, context)
1071+
}
1072+
1073+
1074+
<% unless version == 'ga' -%>
1075+
1076+
func TestAccCloudRunV2Service_cloudrunv2ServiceWithDefaultUriDisabled(t *testing.T) {
1077+
t.Parallel()
1078+
context := map[string]interface{} {
1079+
"random_suffix" : acctest.RandString(t, 10),
1080+
}
1081+
acctest.VcrTest(t, resource.TestCase {
1082+
PreCheck: func() { acctest.AccTestPreCheck(t)},
1083+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
1084+
CheckDestroy: testAccCheckCloudRunV2ServiceDestroyProducer(t),
1085+
Steps: []resource.TestStep{
1086+
{
1087+
Config: testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled(context),
1088+
},
1089+
{
1090+
ResourceName: "google_cloud_run_v2_service.default",
1091+
ImportState: true,
1092+
ImportStateVerify: true,
1093+
ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"},
1094+
},
1095+
{
1096+
Config: testAccCloudRunV2Service_cloudrunv2ServiceWithNoMinInstances(context),
1097+
},
1098+
{
1099+
ResourceName: "google_cloud_run_v2_service.default",
1100+
ImportState: true,
1101+
ImportStateVerify: true,
1102+
ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"},
1103+
},
1104+
1105+
},
1106+
})
1107+
}
1108+
10401109
func testAccCloudRunV2Service_cloudrunv2ServiceWithMinInstancesAndDefaultUriDisabled(context map[string]interface{}) string {
10411110
return acctest.Nprintf(`
10421111
resource "google_cloud_run_v2_service" "default" {
@@ -1073,6 +1142,7 @@ resource "google_cloud_run_v2_service" "default" {
10731142

10741143
`, context)
10751144
}
1145+
10761146
<% end -%>
10771147

10781148
<% unless version == 'ga' -%>

0 commit comments

Comments
 (0)