Skip to content

Commit

Permalink
Added tgc Go cli (GoogleCloudPlatform#11777)
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 authored Sep 23, 2024
1 parent c2ea0c8 commit 13601c0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ tgc:
bundle exec compiler -e terraform -f tgc -v beta -o $(OUTPUT_PATH)/tfplan2cai $(mmv1_compile);\
bundle exec compiler -e terraform -f tgc_cai2hcl -v beta -o $(OUTPUT_PATH)/cai2hcl $(mmv1_compile);\

tgc-go:
cd mmv1;\
go run . --version beta --provider tgc --output $(OUTPUT_PATH)/tfplan2cai;\
go run . --version beta --provider tgc_cai2hcl --output $(OUTPUT_PATH)/cai2hcl;\

tf-oics:
cd mmv1;\
bundle;\
Expand Down
2 changes: 1 addition & 1 deletion mmv1/provider/terraform_tgc.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func retrieveListOfManuallyDefinedTestsFromFile(file string) []string {
}

func (tgc TerraformGoogleConversion) CopyCommonFiles(outputFolder string, generateCode, generateDocs bool) {
log.Printf("Copying common files.")
log.Printf("Copying common files for tgc.")

if !generateCode {
return
Expand Down
4 changes: 4 additions & 0 deletions mmv1/provider/terraform_tgc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def retrieve_full_manifest_of_non_defined_tests

def retrieve_test_source_files(path, suffix)
files = Dir["#{path}**#{suffix}"]
files = files.reject do |file|
file.end_with?('/go')
end

files = files.map { |file| file.split(path)[-1] }
files.sort
end
Expand Down
2 changes: 1 addition & 1 deletion mmv1/provider/terraform_tgc_cai2hcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewCaiToTerraformConversion(product *api.Product, versionName string, start
t.Product.SetPropertiesBasedOnVersion(&t.Version)
for _, r := range t.Product.Objects {
r.SetCompiler(ProviderName(t))
r.ImportPath = ImportPathFromVersion(t, versionName)
r.ImportPath = ImportPathFromVersion(versionName)
}

return t
Expand Down

0 comments on commit 13601c0

Please sign in to comment.