Skip to content

Commit afff5fa

Browse files
modular-magicianchrisst
authored andcommitted
Fix flattened custom patchable resources (#3741)
Signed-off-by: Modular Magician <[email protected]>
1 parent 3035f1b commit afff5fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

google/resource_compute_network.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,12 @@ func resourceComputeNetworkUpdate(d *schema.ResourceData, meta interface{}) erro
272272

273273
if d.HasChange("routing_mode") {
274274
obj := make(map[string]interface{})
275-
routingModeProp := d.Get("routing_mode")
276-
obj["routingMode"] = routingModeProp
275+
routingConfigProp, err := expandComputeNetworkRoutingConfig(nil, d, config)
276+
if err != nil {
277+
return err
278+
} else if v, ok := d.GetOkExists("routing_config"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, routingConfigProp)) {
279+
obj["routingConfig"] = routingConfigProp
280+
}
277281

278282
url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/networks/{{name}}")
279283
if err != nil {

0 commit comments

Comments
 (0)