Skip to content

Commit

Permalink
Clean up delete template (GoogleCloudPlatform#10144)
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson authored and pengq-google committed May 21, 2024
1 parent 2877fbd commit 920b435
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mmv1/templates/terraform/resource.erb
Original file line number Diff line number Diff line change
Expand Up @@ -1047,19 +1047,17 @@ func resource<%= object.resource_name -%>Delete(d *schema.ResourceData, meta int
<% end -%>
<% end -%>
<% if object.supports_indirect_user_project_override -%>
if parts := regexp.MustCompile(`projects\/([^\/]+)\/`).FindStringSubmatch(url); parts != nil {
billingProject = parts[1]
}
<% end -%>
log.Printf("[DEBUG] Deleting <%= object.name -%> %q", d.Id())
// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}
log.Printf("[DEBUG] Deleting <%= object.name -%> %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "<%= object.delete_verb.to_s.upcase -%>",
Expand Down

0 comments on commit 920b435

Please sign in to comment.