Skip to content

Commit

Permalink
Remove the function check field_specific_update_methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 committed Oct 3, 2023
1 parent 39220d2 commit d141415
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions mmv1/api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,6 @@ def get_labels_field_note(title)
Please refer to the field `effective_#{title}` for all of the #{title} present on the resource."
end

def terraform_labels?
terraform_label = root_properties.select do |p|
p.is_a?(Api::Type::KeyValueTerraformLabels)
end

terraform_label.length.positive?
end

# ====================
# Version-related methods
# ====================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if d.HasChange("connected_repositories") {
for _, repo := range removeRepos {
obj := make(map[string]interface{})
obj["connectedRepository"] = repo
res, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
_, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "POST",
Project: billingProject,
Expand Down Expand Up @@ -61,7 +61,7 @@ if d.HasChange("connected_repositories") {
return err
}

res, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "POST",
Project: billingProject,
Expand Down
4 changes: 2 additions & 2 deletions mmv1/templates/terraform/resource.erb
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ func resource<%= resource_name -%>Update(d *schema.ResourceData, meta interface{
billingProject = bp
}

<% if object.update_mask && (field_specific_update_methods(object.root_properties) || object.terraform_labels?) -%>
<% if object.update_mask -%>
// if updateMask is empty we are not updating anything so skip the post
if len(updateMask) > 0 {
<% end -%>
Expand Down Expand Up @@ -838,7 +838,7 @@ if len(updateMask) > 0 {
}
<% end -%>
<% end -%>
<% if object.update_mask && (field_specific_update_methods(object.root_properties) || object.terraform_labels?) -%>
<% if object.update_mask -%>
}
<% end -%>
<% end # if !object.immutable -%>
Expand Down

0 comments on commit d141415

Please sign in to comment.