Skip to content

Commit

Permalink
add two fields to ForceSendFields (#4580) (#8650)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Mar 11, 2021
1 parent 913d98a commit 20c4bfc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/4580.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
container: Fixed updates on `export_custom_routes` and `import_custom_routes` in `google_compute_network_peering`
```
2 changes: 1 addition & 1 deletion google/resource_compute_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func expandNetworkPeering(d *schema.ResourceData) *compute.NetworkPeering {
ImportCustomRoutes: d.Get("import_custom_routes").(bool),
ExportSubnetRoutesWithPublicIp: d.Get("export_subnet_routes_with_public_ip").(bool),
ImportSubnetRoutesWithPublicIp: d.Get("import_subnet_routes_with_public_ip").(bool),
ForceSendFields: []string{"ExportSubnetRoutesWithPublicIp"},
ForceSendFields: []string{"ExportSubnetRoutesWithPublicIp", "ImportCustomRoutes", "ExportCustomRoutes"},
}
}

Expand Down
9 changes: 9 additions & 0 deletions google/resource_compute_network_peering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ func TestAccComputeNetworkPeering_customRoutesUpdate(t *testing.T) {
ImportStateVerify: true,
ImportStateId: importId,
},
{
Config: testAccComputeNetworkPeeringDefaultCustomRoutes(primaryNetworkName, peeringName, suffix),
},
{
ResourceName: "google_compute_network_peering.bar",
ImportState: true,
ImportStateVerify: true,
ImportStateId: importId,
},
},
})
}
Expand Down

0 comments on commit 20c4bfc

Please sign in to comment.