diff --git a/mmv1/third_party/terraform/fwtransport/go/framework_config.go.tmpl b/mmv1/third_party/terraform/fwtransport/go/framework_config.go.tmpl index 7593754f37c1..d148d7e0300f 100644 --- a/mmv1/third_party/terraform/fwtransport/go/framework_config.go.tmpl +++ b/mmv1/third_party/terraform/fwtransport/go/framework_config.go.tmpl @@ -32,11 +32,6 @@ import ( ) type FrameworkProviderConfig struct { - // Temporary, as we'll replace use of FrameworkProviderConfig with transport_tpg.Config soon - // transport_tpg.Config has a Credentials field, hence this change is needed - Credentials types.String - // End temporary - BillingProject types.String Client *http.Client Context context.Context @@ -101,12 +96,6 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context, p.{{ $product.Name }}BasePath = data.{{ $product.Name }}CustomEndpoint.ValueString() {{- end }} - // Temporary - p.Credentials = data.Credentials - // End temporary - - // Copy values from the ProviderModel struct containing data about the provider configuration (present only when responsing to ConfigureProvider rpc calls) - // to the FrameworkProviderConfig struct that will be passed and available to all resources/data sources p.Context = ctx p.BillingProject = data.BillingProject p.DefaultLabels = data.DefaultLabels diff --git a/mmv1/third_party/terraform/go/go.mod b/mmv1/third_party/terraform/go/go.mod index e95bf8e26532..57b44d578a12 100644 --- a/mmv1/third_party/terraform/go/go.mod +++ b/mmv1/third_party/terraform/go/go.mod @@ -117,4 +117,4 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect -) \ No newline at end of file +) diff --git a/mmv1/third_party/terraform/services/cloudrun/go/resource_cloud_run_service_test.go.tmpl b/mmv1/third_party/terraform/services/cloudrun/go/resource_cloud_run_service_test.go.tmpl index ff35d4bc1f81..fb6619b5d5ed 100644 --- a/mmv1/third_party/terraform/services/cloudrun/go/resource_cloud_run_service_test.go.tmpl +++ b/mmv1/third_party/terraform/services/cloudrun/go/resource_cloud_run_service_test.go.tmpl @@ -1320,6 +1320,116 @@ func TestAccCloudRunService_csiVolume(t *testing.T) { project := envvar.GetTestProjectFromEnv() name := "tftest-cloudrun-" + acctest.RandString(t, 6) + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccCloudRunService_cloudRunServiceWithNoVolume(name, project), + }, + { + ResourceName: "google_cloud_run_service.default", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "metadata.0.annotations", "metadata.0.labels", "metadata.0.terraform_labels", "status.0.conditions"}, + }, + { + Config: testAccCloudRunService_cloudRunServiceUpdateWithGcsVolume(name, project,), + }, + { + ResourceName: "google_cloud_run_service.default", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"metadata.0.resource_version", "metadata.0.annotations", "metadata.0.labels", "metadata.0.terraform_labels", "status.0.conditions"}, + }, + }, + }) + } + + +func testAccCloudRunService_cloudRunServiceWithNoVolume(name, project string) string { + return fmt.Sprintf(` +resource "google_cloud_run_service" "default" { + name = "%s" + location = "us-central1" + + metadata { + namespace = "%s" + annotations = { + generated-by = "magic-modules" + } + } + + template { + spec { + containers { + image = "gcr.io/cloudrun/hello" + } + } + } + + lifecycle { + ignore_changes = [ + metadata.0.annotations, + ] + } +} +`, name, project) +} + + +func testAccCloudRunService_cloudRunServiceUpdateWithGcsVolume(name, project string) string { + return fmt.Sprintf(` +resource "google_cloud_run_service" "default" { + name = "%s" + location = "us-central1" + + metadata { + namespace = "%s" + annotations = { + generated-by = "magic-modules" + } + } + + template { + metadata { + annotations = { + "run.googleapis.com/execution-environment" = "gen2" + } + } + spec { + containers { + image = "gcr.io/cloudrun/hello" + volume_mounts { + name = "vol1" + mount_path = "/mnt/vol1" + } + } + volumes { + name = "vol1" + csi { + driver = "gcsfuse.run.googleapis.com" + read_only = true + volume_attributes = { + bucketName = "gcp-public-data-landsat" + } + } + } + } + } + +} +`, name, project) +} + + {{ if ne $.TargetVersionName `ga` -}} + +func TestAccCloudRunService_emptyDirVolume(t *testing.T) { + t.Parallel() + + project := envvar.GetTestProjectFromEnv() + name := "tftest-cloudrun-" + acctest.RandString(t, 6) + acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), diff --git a/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_job_test.go.tmpl b/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_job_test.go.tmpl index 34668772d7f1..2100167eb985 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_job_test.go.tmpl +++ b/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_job_test.go.tmpl @@ -350,7 +350,6 @@ func testAccCloudRunV2Job_cloudrunv2JobWithNoVolume(context map[string]interface name = "%{job_name}" location = "us-central1" deletion_protection = false - launch_stage = "BETA" template { template { containers { @@ -374,7 +373,6 @@ func testAccCloudRunV2Job_cloudrunv2JobWithGcsVolume(context map[string]interfac name = "%{job_name}" location = "us-central1" deletion_protection = false - launch_stage = "BETA" template { template { containers { @@ -444,7 +442,6 @@ func testAccCloudRunV2Job_cloudrunv2JobWithNfsVolume(context map[string]interfac name = "%{job_name}" location = "us-central1" deletion_protection = false - launch_stage = "BETA" template { template { containers { diff --git a/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_service_test.go.tmpl b/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_service_test.go.tmpl index f6d74f521320..96026c217727 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_service_test.go.tmpl +++ b/mmv1/third_party/terraform/services/cloudrunv2/go/resource_cloud_run_v2_service_test.go.tmpl @@ -242,7 +242,7 @@ resource "google_cloud_run_v2_service" "default" { description = "description creating" location = "us-central1" deletion_protection = false - launch_stage = "BETA" + annotations = { generated-by = "magic-modules" }