From afff5faac6e6bf72fe2f6717b9c7b3a4c3df6e2a Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 30 May 2019 12:53:12 -0700 Subject: [PATCH] Fix flattened custom patchable resources (#3741) Signed-off-by: Modular Magician --- google/resource_compute_network.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/google/resource_compute_network.go b/google/resource_compute_network.go index f241e91ae04..5873f65942b 100644 --- a/google/resource_compute_network.go +++ b/google/resource_compute_network.go @@ -272,8 +272,12 @@ func resourceComputeNetworkUpdate(d *schema.ResourceData, meta interface{}) erro if d.HasChange("routing_mode") { obj := make(map[string]interface{}) - routingModeProp := d.Get("routing_mode") - obj["routingMode"] = routingModeProp + routingConfigProp, err := expandComputeNetworkRoutingConfig(nil, d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("routing_config"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, routingConfigProp)) { + obj["routingConfig"] = routingConfigProp + } url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/networks/{{name}}") if err != nil {