Skip to content

tgc-revival: Only print compute instance asset name in logs #13739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions mmv1/third_party/terraform/acctest/tgc_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func GetTestMetadataForTgc(service, address, rawConfig string) resource.TestChec
if apiServiceName, ok := ApiServiceNames[resourceType]; !ok {
return fmt.Errorf("The Cai product backend name for resource %s doesn't exist.", resourceType)
} else {
var assetNames string
var rName string
switch resourceType {
case "google_project":
Expand All @@ -50,17 +49,7 @@ func GetTestMetadataForTgc(service, address, rawConfig string) resource.TestChec
rName = rState.Primary.ID
}
caiAssetName := fmt.Sprintf("//%s/%s", apiServiceName, rName)

switch resourceType {
case "google_compute_instance":
// The disk asset name is to get the boot disk details,
// which are converted to boot_disk.initialize_params in google_compute_instance
diskAssetName := strings.Replace(caiAssetName, "/instances/", "/disks/", 1)
assetNames = fmt.Sprintf("%s\n%s", caiAssetName, diskAssetName)
default:
assetNames = caiAssetName
}
log.Printf("[DEBUG]TGC CAI asset names\n%s\nEnd of TGC CAI asset names", assetNames)
log.Printf("[DEBUG]TGC CAI asset names start\n%s\nEnd of TGC CAI asset names", caiAssetName)
}

// The acceptance tests names will be also used for the tgc tests.
Expand Down
Loading