From c09666aefcdf3080f48ddaa6c226103963e75df8 Mon Sep 17 00:00:00 2001 From: Zhenhua Li Date: Thu, 26 Sep 2024 13:34:09 -0700 Subject: [PATCH] test --- mmv1/provider/template_data.go | 4 +--- .../terraform/provider/provider_mmv1_resources.go.tmpl | 5 +---- mmv1/third_party/tgc/resource_converters.go.tmpl | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/mmv1/provider/template_data.go b/mmv1/provider/template_data.go index 15f4d3024a46..c2441176b67f 100644 --- a/mmv1/provider/template_data.go +++ b/mmv1/provider/template_data.go @@ -187,8 +187,6 @@ func (td *TemplateData) GenerateTGCIamResourceFile(filePath string, resource api } func (td *TemplateData) GenerateFile(filePath, templatePath string, input any, goFormat bool, templates ...string) { - // log.Printf("Generating %s", filePath) - templateFileName := filepath.Base(templatePath) tmpl, err := template.New(templateFileName).Funcs(google.TemplateFunctions).ParseFiles(templates...) @@ -218,7 +216,7 @@ func (td *TemplateData) GenerateFile(filePath, templatePath string, input any, g } if goFormat && !strings.Contains(templatePath, "third_party/terraform") { - cmd := exec.Command("goimports", "-w", filePath) + cmd := exec.Command(filePath, "goimports", "-w") if err := cmd.Run(); err != nil { log.Fatal(err) } diff --git a/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.tmpl b/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.tmpl index adb73d3533c1..7913bb28c3f1 100644 --- a/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.tmpl +++ b/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.tmpl @@ -10,10 +10,7 @@ import ( {{ if eq $.TargetVersionName `ga` }} "github.com/hashicorp/terraform-provider-google/google/services/composer" {{- end }} - "github.com/hashicorp/terraform-provider-google/google/services/container" - "github.com/hashicorp/terraform-provider-google/google/services/containeraws" - "github.com/hashicorp/terraform-provider-google/google/services/containerazure" - "github.com/hashicorp/terraform-provider-google/google/services/dataflow" + "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" ) diff --git a/mmv1/third_party/tgc/resource_converters.go.tmpl b/mmv1/third_party/tgc/resource_converters.go.tmpl index d4e20c1d51cf..e809abfae75e 100644 --- a/mmv1/third_party/tgc/resource_converters.go.tmpl +++ b/mmv1/third_party/tgc/resource_converters.go.tmpl @@ -30,7 +30,6 @@ package google import ( "sort" "github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/cai" - "github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/services/accesscontextmanager" "github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/services/alloydb" "github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/services/apigee" "github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/services/artifactregistry"