66
77 "github.com/hashicorp/terraform-plugin-testing/helper/resource"
88 "github.com/hashicorp/terraform-provider-google/google/acctest"
9- "github.com/hashicorp/terraform-provider-google/google/envvar"
9+ "github.com/hashicorp/terraform-provider-google/google/envvar"
1010)
1111
1212func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolFullUpdate (t * testing.T ) {
@@ -43,7 +43,6 @@ func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolFullUpdate(t *testing.T) {
4343 })
4444}
4545
46-
4746func testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolFull (context map [string ]interface {}) string {
4847 return acctest .Nprintf (`
4948resource "google_cloud_run_v2_worker_pool" "default" {
@@ -163,7 +162,7 @@ resource "google_service_account" "service_account" {
163162}
164163func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolGcsVolume (t * testing.T ) {
165164 acctest .SkipIfVcr (t )
166- t.Parallel()
165+ t .Parallel ()
167166
168167 context := map [string ]interface {}{
169168 "random_suffix" : acctest .RandString (t , 10 ),
@@ -182,8 +181,8 @@ func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolGcsVolume(t *testing.T) {
182181 ImportState : true ,
183182 ImportStateVerify : true ,
184183 ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "labels" , "terraform_labels" , "launch_stage" , "deletion_protection" },
185- },
186- },
184+ },
185+ },
187186 })
188187}
189188
@@ -219,9 +218,7 @@ resource "google_cloud_run_v2_worker_pool" "default" {
219218 gcs {
220219 bucket = "gcp-public-data-landsat"
221220 read_only = true
222- {{ if ne $.TargetVersionName `ga` -}}
223- mount_options = ["log-severity=info"]
224- {{ end }}
221+ mount_options = ["log-severity=info"]
225222 }
226223 }
227224 containers {
@@ -263,7 +260,7 @@ func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithDirectVPCUpdate(t *test
263260 workerPoolName := fmt .Sprintf ("tf-test-cloudrun-worker-pool%s" , acctest .RandString (t , 10 ))
264261 context := map [string ]interface {}{
265262 "service_name" : workerPoolName ,
266- "project": envvar.GetTestProjectFromEnv(),
263+ "project" : envvar .GetTestProjectFromEnv (),
267264 }
268265
269266 acctest .VcrTest (t , resource.TestCase {
@@ -346,7 +343,7 @@ resource "google_cloud_run_v2_worker_pool" "default" {
346343func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolCustomAudienceUpdate (t * testing.T ) {
347344 t .Parallel ()
348345
349- workerPoolName := fmt.Sprintf("tf-test-cloudrun-worker-pool%s", acctest.RandString(t, 10))
346+ workerPoolName := fmt .Sprintf ("tf-test-cloudrun-worker-pool%s" , acctest .RandString (t , 10 ))
350347
351348 acctest .VcrTest (t , resource.TestCase {
352349 PreCheck : func () { acctest .AccTestPreCheck (t ) },
@@ -362,7 +359,7 @@ func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolCustomAudienceUpdate(t *tes
362359 ImportStateVerify : true ,
363360 ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "launch_stage" , "deletion_protection" },
364361 },
365- {
362+ {
366363 Config : testAccCloudRunV2WorkerPool_cloudRunWorkerPoolUpdateWithCustomAudience (workerPoolName , "test_update" ),
367364 },
368365 {
@@ -419,7 +416,6 @@ resource "google_cloud_run_v2_worker_pool" "default" {
419416` , workerPoolName , customAudience )
420417}
421418
422-
423419func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolAttributionLabel (t * testing.T ) {
424420 t .Parallel ()
425421
@@ -523,36 +519,35 @@ resource "google_cloud_run_v2_worker_pool" "default" {
523519}
524520
525521func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualScaling (t * testing.T ) {
526- t.Parallel()
527- context := map[string]interface{} {
528- "random_suffix" : acctest.RandString(t, 10),
529- }
530- acctest.VcrTest(t, resource.TestCase {
531- PreCheck: func() { acctest.AccTestPreCheck(t)},
532- ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
533- CheckDestroy: testAccCheckCloudRunV2WorkerPoolDestroyProducer(t),
534- Steps: []resource.TestStep{
535- {
536- Config: testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualScaling(context),
537- },
538- {
539- ResourceName: "google_cloud_run_v2_worker_pool.default",
540- ImportState: true,
541- ImportStateVerify: true,
542- ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"},
543- },
544- {
545- Config: testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolUpdateWithManualScaling(context),
546- },
547- {
548- ResourceName: "google_cloud_run_v2_worker_pool.default",
549- ImportState: true,
550- ImportStateVerify: true,
551- ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"},
552- },
553-
554- },
555- })
522+ t .Parallel ()
523+ context := map [string ]interface {}{
524+ "random_suffix" : acctest .RandString (t , 10 ),
525+ }
526+ acctest .VcrTest (t , resource.TestCase {
527+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
528+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
529+ CheckDestroy : testAccCheckCloudRunV2WorkerPoolDestroyProducer (t ),
530+ Steps : []resource.TestStep {
531+ {
532+ Config : testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualScaling (context ),
533+ },
534+ {
535+ ResourceName : "google_cloud_run_v2_worker_pool.default" ,
536+ ImportState : true ,
537+ ImportStateVerify : true ,
538+ ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "labels" , "terraform_labels" , "launch_stage" , "deletion_protection" },
539+ },
540+ {
541+ Config : testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolUpdateWithManualScaling (context ),
542+ },
543+ {
544+ ResourceName : "google_cloud_run_v2_worker_pool.default" ,
545+ ImportState : true ,
546+ ImportStateVerify : true ,
547+ ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "labels" , "terraform_labels" , "launch_stage" , "deletion_protection" },
548+ },
549+ },
550+ })
556551}
557552
558553func testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualScaling (context map [string ]interface {}) string {
@@ -617,26 +612,26 @@ resource "google_cloud_run_v2_worker_pool" "default" {
617612}
618613
619614func TestAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualInstanceCountZero (t * testing.T ) {
620- t.Parallel()
621- context := map[string]interface{} {
622- "random_suffix" : acctest.RandString(t, 10),
623- }
624- acctest.VcrTest(t, resource.TestCase {
625- PreCheck: func() { acctest.AccTestPreCheck(t)},
626- ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
627- CheckDestroy: testAccCheckCloudRunV2WorkerPoolDestroyProducer(t),
628- Steps: []resource.TestStep{
629- {
630- Config: testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualInstanceCountZero(context),
631- },
632- {
633- ResourceName: "google_cloud_run_v2_worker_pool.default",
634- ImportState: true,
635- ImportStateVerify: true,
636- ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"},
637- },
638- },
639- })
615+ t .Parallel ()
616+ context := map [string ]interface {}{
617+ "random_suffix" : acctest .RandString (t , 10 ),
618+ }
619+ acctest .VcrTest (t , resource.TestCase {
620+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
621+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
622+ CheckDestroy : testAccCheckCloudRunV2WorkerPoolDestroyProducer (t ),
623+ Steps : []resource.TestStep {
624+ {
625+ Config : testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualInstanceCountZero (context ),
626+ },
627+ {
628+ ResourceName : "google_cloud_run_v2_worker_pool.default" ,
629+ ImportState : true ,
630+ ImportStateVerify : true ,
631+ ImportStateVerifyIgnore : []string {"name" , "location" , "annotations" , "labels" , "terraform_labels" , "launch_stage" , "deletion_protection" },
632+ },
633+ },
634+ })
640635}
641636
642637func testAccCloudRunV2WorkerPool_cloudrunv2WorkerPoolWithManualInstanceCountZero (context map [string ]interface {}) string {
@@ -668,4 +663,4 @@ resource "google_cloud_run_v2_worker_pool" "default" {
668663}
669664
670665` , context )
671- }
666+ }
0 commit comments