Skip to content

Commit a52bd6f

Browse files
authored
Update provider for tgc tests (#15750)
1 parent 5425dbd commit a52bd6f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

mmv1/third_party/terraform/acctest/resource_inventory_reader.go renamed to mmv1/third_party/terraform/acctest/resource_inventory_reader.go.tmpl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ var (
3636
"_iam_binding",
3737
"_iam_policy",
3838
}
39+
40+
{{ if eq $.TargetVersionName `ga` -}}
41+
providerName = "google"
42+
{{- else }}
43+
providerName = "google-beta"
44+
{{- end }}
45+
3946
)
4047

4148
// PopulateMetadataCache walks through all metadata files once and populates
@@ -180,7 +187,7 @@ func getServicesDir() (string, error) {
180187
// Try to find project root
181188
root, err := findProjectRoot()
182189
if err == nil {
183-
servicesDir := filepath.Join(root, "google-beta", "services")
190+
servicesDir := filepath.Join(root, providerName, "services")
184191
if _, err := os.Stat(servicesDir); err == nil {
185192
return servicesDir, nil
186193
}
@@ -194,9 +201,9 @@ func getServicesDir() (string, error) {
194201

195202
// Try a few common relative paths
196203
potentialPaths := []string{
197-
filepath.Join(currentDir, "google-beta", "services"),
198-
filepath.Join(currentDir, "..", "google-beta", "services"),
199-
filepath.Join(currentDir, "..", "..", "google-beta", "services"),
204+
filepath.Join(currentDir, providerName, "services"),
205+
filepath.Join(currentDir, "..", providerName, "services"),
206+
filepath.Join(currentDir, "..", "..", providerName, "services"),
200207
}
201208

202209
for _, path := range potentialPaths {

0 commit comments

Comments
 (0)