Skip to content

Commit 3128bac

Browse files
authored
Modify test file generation to use resource ImportPath (#15002)
1 parent 546c24c commit 3128bac

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

mmv1/provider/template_data.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (td *TemplateData) GenerateTestFile(filePath string, resource api.Resource)
144144
}
145145
tmplInput := TestInput{
146146
Res: resource,
147-
ImportPath: td.ImportPath(),
147+
ImportPath: resource.ImportPath,
148148
PROJECT_NAME: "my-project-name",
149149
CREDENTIALS: "my/credentials/filename.json",
150150
REGION: "us-west1",
@@ -281,15 +281,6 @@ func (td *TemplateData) GenerateFile(filePath, templatePath string, input any, g
281281
}
282282
}
283283

284-
func (td *TemplateData) ImportPath() string {
285-
if td.VersionName == GA_VERSION {
286-
return "github.com/hashicorp/terraform-provider-google/google"
287-
} else if td.VersionName == ALPHA_VERSION || td.VersionName == PRIVATE_VERSION {
288-
return "internal/terraform-next/google-private"
289-
}
290-
return "github.com/hashicorp/terraform-provider-google-beta/google-beta"
291-
}
292-
293284
func FixImports(outputPath string, dumpDiffs bool) {
294285
log.Printf("Fixing go import paths")
295286

0 commit comments

Comments
 (0)